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 ofGZIPOutputStream
that reuses underlyingDeflater
instance}.
-
-
Field Summary
Fields Modifier and Type Field Description protected CRC32
_crc
protected Deflater
_deflater
protected DeflaterOutputStream
_deflaterOut
protected byte[]
_eightByteBuffer
protected GZIPRecycler
_gzipRecycler
protected OutputStream
_rawOut
Underlying 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 void
close()
void
flush()
void
write(byte[] buf)
void
write(byte[] buf, int off, int len)
void
write(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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
write
public final void write(byte[] buf) throws IOException
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
public final void write(int c) throws IOException
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
public void write(byte[] buf, int off, int len) throws IOException
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
-