Class ZstandardCompression
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.compression.Compression
org.eclipse.jetty.compression.zstandard.ZstandardCompression
- All Implemented Interfaces:
Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
Compression for Zstandard.
Note about ByteBufferPool
: the zstd-jni
project requires ByteBuffer
implementations that are array backed with a zero arrayOffset.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopException
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer, Dumpable.DumpAppendable
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionacquireByteBuffer
(int length) Acquire aRetainableByteBuffer
that is managed by thisCompression
implementation which is suitable for compressed output from anEncoderSink
or compressed input from aDecoderSource
.TheHttpField
forContent-Encoding
suitable for this Compression implementation.The filename extensions for this compression implementation.getName()
TheHttpField
forX-Content-Encoding
suitable for this Compression implementation.newDecoderInputStream
(InputStream in, DecoderConfig config) Create a newInputStream
to decode (decompress) with this compression implementation.newDecoderSource
(Content.Source source, DecoderConfig config) Create a newDecoderSource
for this compression implementationnewEncoderOutputStream
(OutputStream out, EncoderConfig config) Create a newOutputStream
to encode (compress) with this compression implementation.newEncoderSink
(Content.Sink sink, EncoderConfig config) Create a newEncoderSink
for this compression implementationvoid
setDefaultDecoderConfig
(DecoderConfig config) void
setDefaultEncoderConfig
(EncoderConfig config) void
setMinCompressSize
(int minCompressSize) Methods inherited from class org.eclipse.jetty.compression.Compression
doStart, etag, getBufferSize, getByteBufferPool, getContainer, getEncodingName, getEtagSuffix, getMinCompressSize, newDecoderInputStream, newDecoderSource, newEncoderOutputStream, newEncoderSink, setBufferSize, setByteBufferPool, setContainer, stripSuffixes
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStop, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListeners
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Constructor Details
-
ZstandardCompression
public ZstandardCompression()
-
-
Method Details
-
acquireByteBuffer
Description copied from class:Compression
Acquire aRetainableByteBuffer
that is managed by thisCompression
implementation which is suitable for compressed output from anEncoderSink
or compressed input from aDecoderSource
.It is recommended to use this method so that any compression specific details can be managed by this Compression implementation (such as ByteOrder or buffer pooling)
- Specified by:
acquireByteBuffer
in classCompression
- Parameters:
length
- the requested size of the buffer- Returns:
- the ByteBuffer suitable for this compression implementation.
-
getContentEncodingField
Description copied from class:Compression
TheHttpField
forContent-Encoding
suitable for this Compression implementation.- Specified by:
getContentEncodingField
in classCompression
- Returns:
- the HttpField for
Content-Encoding
.
-
getDefaultDecoderConfig
- Specified by:
getDefaultDecoderConfig
in classCompression
-
setDefaultDecoderConfig
- Specified by:
setDefaultDecoderConfig
in classCompression
-
getDefaultEncoderConfig
- Specified by:
getDefaultEncoderConfig
in classCompression
-
setDefaultEncoderConfig
- Specified by:
setDefaultEncoderConfig
in classCompression
-
getFileExtensionNames
Description copied from class:Compression
The filename extensions for this compression implementation.Not an exhaustive list, just the most commonly seen extensions.
- Specified by:
getFileExtensionNames
in classCompression
- Returns:
- the list of common extension names (all lowercase) for this compression implementation. ordered by most common to least common.
-
setMinCompressSize
public void setMinCompressSize(int minCompressSize) - Overrides:
setMinCompressSize
in classCompression
-
getName
- Specified by:
getName
in classCompression
- Returns:
- the name of the compression implementation.
-
getXContentEncodingField
Description copied from class:Compression
TheHttpField
forX-Content-Encoding
suitable for this Compression implementation.- Specified by:
getXContentEncodingField
in classCompression
- Returns:
- the HttpField for
X-Content-Encoding
.
-
newDecoderInputStream
Description copied from class:Compression
Create a newInputStream
to decode (decompress) with this compression implementation.- Specified by:
newDecoderInputStream
in classCompression
- Parameters:
in
- the input stream to write the decoded (decompressed) bytes toconfig
- theDecoderConfig
for this input stream.- Returns:
- the
InputStream
implementation for this compression. - Throws:
IOException
- if unable to create InputStream
-
newDecoderSource
Description copied from class:Compression
Create a newDecoderSource
for this compression implementation- Specified by:
newDecoderSource
in classCompression
- Parameters:
source
- the source to write the decoded bytes toconfig
- theDecoderConfig
for this source.- Returns:
- a new
DecoderSource
-
newEncoderOutputStream
public OutputStream newEncoderOutputStream(OutputStream out, EncoderConfig config) throws IOException Description copied from class:Compression
Create a newOutputStream
to encode (compress) with this compression implementation.- Specified by:
newEncoderOutputStream
in classCompression
- Parameters:
out
- the output stream to write the encoded (compressed) bytes toconfig
- theEncoderConfig
for this output stream.- Returns:
- the
OutputStream
implementation for this compression. - Throws:
IOException
- if unable to create OutputStream
-
newEncoderSink
Description copied from class:Compression
Create a newEncoderSink
for this compression implementation- Specified by:
newEncoderSink
in classCompression
- Parameters:
sink
- the sink to write the encoded bytes toconfig
- theEncoderConfig
for this sink.- Returns:
- a new
EncoderSink
-