while ((numChars < length) && ((ch = iis.read()) != -1)) { numChars++; uncompressed.append((char) ch);
TempStream out = new TempStream();  TempBuffer tempBuf = TempBuffer.allocate(); byte []buffer = tempBuf.getBuffer();  int len; while ((len = in.read(buffer, 0, buffer.length)) >= 0) { out.write(buffer, 0, len, false);
  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());  }