Package com.ning.compress.gzip
Class OptimizedGZIPOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- com.ning.compress.gzip.OptimizedGZIPOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class OptimizedGZIPOutputStream extends OutputStream
Optimized variant ofGZIPOutputStreamthat reuses underlyingDeflaterinstance}.
-
-
Field Summary
Fields Modifier and Type Field Description protected CRC32_crcprotected Deflater_deflaterprotected DeflaterOutputStream_deflaterOutprotected byte[]_eightByteBufferprotected GZIPRecycler_gzipRecyclerprotected OutputStream_rawOutUnderlying output stream that header, compressed content and footer go to
-
Constructor Summary
Constructors Constructor Description OptimizedGZIPOutputStream(OutputStream out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()voidwrite(byte[] buf)voidwrite(byte[] buf, int off, int len)voidwrite(int c)-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Field Detail
-
_deflater
protected Deflater _deflater
-
_gzipRecycler
protected final GZIPRecycler _gzipRecycler
-
_eightByteBuffer
protected final byte[] _eightByteBuffer
-
_rawOut
protected OutputStream _rawOut
Underlying output stream that header, compressed content and footer go to
-
_deflaterOut
protected DeflaterOutputStream _deflaterOut
-
_crc
protected CRC32 _crc
-
-
Constructor Detail
-
OptimizedGZIPOutputStream
public OptimizedGZIPOutputStream(OutputStream out) throws IOException
- Throws:
IOException
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
write
public final void write(byte[] buf) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
write
public final void write(int c) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] buf, int off, int len) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
-