public byte[] decompress(DataInput is){
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  try {
    while (true) {
      byte b=is.readByte();
      if (b == -1)       break;
      baos.write(b);
    }
  }
 catch (  EOFException ex) {
  }
catch (  IOException ex) {
    throw new RuntimeException(ex);
  }
  return decompress(baos.toByteArray());
}

public byte [ ] decompress ( DataInput is ) { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; try { while ( true ) { byte b = is . readByte ( ) ; if ( b == - 1 ) break ; baos . write ( b ) ; } } catch ( EOFException ex ) { } catch ( IOException ex ) { throw new RuntimeException ( ex ) ; } return decompress ( baos . toByteArray ( ) ) ; }
decompress an input stream until eof .
