I'm trying to convert this java snippet code in c# but I'm a bit confused about it. This is the java code:
My try is the following, but there are some errors in gis.Read, because it wants a char* and not a byte[] and in the String constructor for the same reason.
public static String decompress(InputStream input) throws IOException 
{
    final int BUFFER_SIZE = 32;
    GZIPInputStream gis = new GZIPInputStream(input, BUFFER_SIZE);
    StringBuilder string = new StringBuilder();
    byte[] data = new byte[BUFFER_SIZE];
    int bytesRead;
    while ((bytesRead = gis.read(data)) != -1) {
        string.append(new String(data, 0, bytesRead));
    }
    gis.close();
    // is.close();
    return string.toString();
}
I expected to get a readable string.
 
     
    