public byte[] decompress(DataInput is,int nbytes){
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  try {
    int c=0;
    while (c < nbytes) {
      byte b=is.readByte();
      if (b == -1)       break;
      baos.write(b);
      c++;
    }
  }
 catch (  IOException ex) {
    throw new RuntimeException(ex);
  }
  return decompress(baos.toByteArray());
}

public byte [ ] decompress ( DataInput is , int nbytes ) { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; try { int c = 0 ; while ( c < nbytes ) { byte b = is . readByte ( ) ; if ( b == - 1 ) break ; baos . write ( b ) ; c ++ ; } } catch ( IOException ex ) { throw new RuntimeException ( ex ) ; } return decompress ( baos . toByteArray ( ) ) ; }
decompress n bytes from the input stream .
