Package org.opensearch.common.compress
Class DeflateCompressor
java.lang.Object
org.opensearch.common.compress.DeflateCompressor
- All Implemented Interfaces:
org.opensearch.core.compress.Compressor
Compressor
implementation based on the DEFLATE compression algorithm.- Opensearch.api:
- - registered name requires BWC support
- Opensearch.experimental:
- - class methods might change
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.opensearch.core.common.bytes.BytesReference
compress
(org.opensearch.core.common.bytes.BytesReference bytesReference) int
static InputStream
inputStream
(InputStream in, boolean threadLocal) Creates a new input stream that decompresses the contents read from the provided input stream.boolean
isCompressed
(org.opensearch.core.common.bytes.BytesReference bytes) org.opensearch.core.common.bytes.BytesReference
uncompress
(org.opensearch.core.common.bytes.BytesReference bytesReference)
-
Field Details
-
NAME
The name to register the compressor by- Opensearch.api:
- - requires BWC support
-
-
Constructor Details
-
DeflateCompressor
public DeflateCompressor()
-
-
Method Details
-
isCompressed
public boolean isCompressed(org.opensearch.core.common.bytes.BytesReference bytes) - Specified by:
isCompressed
in interfaceorg.opensearch.core.compress.Compressor
-
headerLength
public int headerLength()- Specified by:
headerLength
in interfaceorg.opensearch.core.compress.Compressor
-
threadLocalInputStream
- Specified by:
threadLocalInputStream
in interfaceorg.opensearch.core.compress.Compressor
- Throws:
IOException
-
inputStream
Creates a new input stream that decompresses the contents read from the provided input stream. Closing the returned stream will close the provided input stream. Optionally uses thread-local, pooled resources to save off-heap allocations if the stream is guaranteed to not escape the current thread.- Parameters:
in
- input stream to wrapthreadLocal
- whether this stream will only be used on the current thread or not- Returns:
- decompressing stream
- Throws:
IOException
-
threadLocalOutputStream
- Specified by:
threadLocalOutputStream
in interfaceorg.opensearch.core.compress.Compressor
- Throws:
IOException
-
uncompress
public org.opensearch.core.common.bytes.BytesReference uncompress(org.opensearch.core.common.bytes.BytesReference bytesReference) throws IOException - Specified by:
uncompress
in interfaceorg.opensearch.core.compress.Compressor
- Throws:
IOException
-
compress
public org.opensearch.core.common.bytes.BytesReference compress(org.opensearch.core.common.bytes.BytesReference bytesReference) throws IOException - Specified by:
compress
in interfaceorg.opensearch.core.compress.Compressor
- Throws:
IOException
-