Interface Compressor
- All Known Implementing Classes:
DeflateCompressor
public interface Compressor
-
Method Summary
Modifier and Type Method Description BytesReference
compress(BytesReference bytesReference)
Compress bytes into a newly allocated buffer.int
headerLength()
boolean
isCompressed(BytesReference bytes)
java.io.InputStream
threadLocalInputStream(java.io.InputStream in)
Creates a new input stream that decompresses the contents read from the provided input stream.java.io.OutputStream
threadLocalOutputStream(java.io.OutputStream out)
Creates a new output stream that compresses the contents and writes to the provided output stream.BytesReference
uncompress(BytesReference bytesReference)
Decompress bytes into a newly allocated buffer.
-
Method Details
-
isCompressed
-
headerLength
int headerLength() -
threadLocalInputStream
java.io.InputStream threadLocalInputStream(java.io.InputStream in) throws java.io.IOExceptionCreates a new input stream that decompresses the contents read from the provided input stream. Closing the returnedInputStream
will close the provided stream input. Note: The returned stream may only be used on the thread that created it as it might use thread-local resources and must be safely closed after use- Throws:
java.io.IOException
-
threadLocalOutputStream
java.io.OutputStream threadLocalOutputStream(java.io.OutputStream out) throws java.io.IOExceptionCreates a new output stream that compresses the contents and writes to the provided output stream. Closing the returnedOutputStream
will close the provided output stream. Note: The returned stream may only be used on the thread that created it as it might use thread-local resources and must be safely closed after use- Throws:
java.io.IOException
-
uncompress
Decompress bytes into a newly allocated buffer.- Parameters:
bytesReference
- bytes to decompress- Returns:
- decompressed bytes
- Throws:
java.io.IOException
-
compress
Compress bytes into a newly allocated buffer.- Parameters:
bytesReference
- bytes to compress- Returns:
- compressed bytes
- Throws:
java.io.IOException
-