@InterfaceAudience.Public @InterfaceStability.Evolving public interface Compressor
CompressionOutputStream
to compress data.
This is modelled after Deflater
Modifier and Type | Method and Description |
---|---|
int |
compress(byte[] b,
int off,
int len)
Fills specified buffer with compressed data.
|
void |
end()
Closes the compressor and discards any unprocessed input.
|
void |
finish()
When called, indicates that compression should end
with the current contents of the input buffer.
|
boolean |
finished()
Returns true if the end of the compressed
data output stream has been reached.
|
long |
getBytesRead()
Return number of uncompressed bytes input so far.
|
long |
getBytesWritten()
Return number of compressed bytes output so far.
|
boolean |
needsInput()
Returns true if the input data buffer is empty and
#setInput() should be called to provide more input.
|
void |
reinit(Configuration conf)
Prepare the compressor to be used in a new stream with settings defined in
the given Configuration
|
void |
reset()
Resets compressor so that a new set of input data can be processed.
|
void |
setDictionary(byte[] b,
int off,
int len)
Sets preset dictionary for compression.
|
void |
setInput(byte[] b,
int off,
int len)
Sets input data for compression.
|
void setInput(byte[] b, int off, int len)
true
indicating that more input data is required.b
- Input dataoff
- Start offsetlen
- Lengthboolean needsInput()
true
if the input data buffer is empty and
#setInput() should be called in order to provide more input.void setDictionary(byte[] b, int off, int len)
b
- Dictionary data bytesoff
- Start offsetlen
- Lengthlong getBytesRead()
long getBytesWritten()
void finish()
boolean finished()
true
if the end of the compressed
data output stream has been reached.int compress(byte[] b, int off, int len) throws IOException
b
- Buffer for the compressed dataoff
- Start offset of the datalen
- Size of the bufferIOException
void reset()
void end()
void reinit(Configuration conf)
conf
- Configuration from which new setting are fetchedCopyright © 2017 Apache Software Foundation. All rights reserved.