code: public static RamDisk readGzipped(InputStream in) throws IOException {
          final GZIPInputStream zis = new GZIPInputStream(in);
          ByteArrayOutputStream bos = new ByteArrayOutputStream();
          
          final byte[] buffer = new byte[4096];
          
          int read = zis.read(buffer);
          int total = 0;
          
          while (read >= 0) {
              total += read;
              bos.write(buffer, 0, read);
              read = zis.read(buffer);
          }
  
          if (total < DEFAULT_SECTOR_SIZE) throw new IOException(
                  "read only " + total + " bytes"); //NOI18N
                  
          final ByteBuffer bb = ByteBuffer.wrap(bos.toByteArray(), 0, total);
          return new RamDisk(bb, DEFAULT_SECTOR_SIZE);
      }
docs: Reads a GZIP compressed disk image from the specified input stream and
  returns a {@code RamDisk} holding the decompressed image.
  
  @param in the stream to read the disk image from
  @return the decompressed {@code RamDisk}
  @throws IOException on read or decompression error