/** * Call to this method will result in call to * {@link Uncompressor#complete()}, which is idempotent * (i.e. can be called multiple times without ill effects). */ @Override public void close() throws IOException { _uncompressor.complete(); }
/** * Call to this method will result in call to * {@link Uncompressor#complete()}, which is idempotent * (i.e. can be called multiple times without ill effects). */ @Override public void close() throws IOException { _uncompressor.complete(); }
/** * Call to this method will result in call to * {@link Uncompressor#complete()}, which is idempotent * (i.e. can be called multiple times without ill effects). */ @Override public void close() throws IOException { _uncompressor.complete(); }
/** * Method called in cases where the compressed file can be fully read * in a single buffer, to be uncompressed and written. */ protected void _readAllWriteAllCompressed(final OutputStream out, final byte[] copyBuffer, final long offset, final long dataLength) throws IOException { // important: specify no offset, file length; data offset/length is for _uncompressed_ int inputLength = (int) _fileLength; _readAll(out, copyBuffer, 0L, inputLength); // Compress-Ning package allows "push" style uncompression (yay!) Uncompressor uncomp; DataHandler h = new RangedDataHandler(out, offset, dataLength); if (_compression == Compression.LZF) { uncomp = new LZFUncompressor(h); } else if (_compression == Compression.GZIP) { uncomp = new GZIPUncompressor(h); } else { // otherwise, must use bulk operations? // TODO: currently we do not have other codecs throw new UnsupportedOperationException("No Uncompressor for compression type: "+_compression); } final long start = (_diagnostics == null) ? 0L : _timeMaster.nanosForDiagnostics(); uncomp.feedCompressedData(copyBuffer, 0, inputLength); uncomp.complete(); if (_diagnostics != null) { _diagnostics.addResponseWriteTime(start, _timeMaster); } }