StringBuilder uncompressed = new StringBuilder(); int numChars = 0; int ch;
InflaterInputStream in = new InflaterInputStream(is);
  public Value gzuncompress(InputStream is,                            @Optional("0") long length)    throws DataFormatException, IOException  {    if (length == 0)      length = Long.MAX_VALUE;    InflaterInputStream iis = new InflaterInputStream(is, new Inflater());    StringBuilder uncompressed = new StringBuilder();    int numChars = 0;    int ch;    while ((numChars < length) && ((ch = iis.read()) != -1)) {      numChars++;      uncompressed.append((char) ch);    }    return new StringValueImpl(uncompressed.toString());  }