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 AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface Dumpable
Dumpable.DumpableContainer, Dumpable.DumpAppendableNested classes/interfaces inherited from interface LifeCycle
LifeCycle.Listener - 
Field Summary
 - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionacquireByteBuffer(int length) Acquire aRetainableByteBufferthat is managed by thisCompressionimplementation which is suitable for compressed output from anEncoderSinkor compressed input from aDecoderSource.TheHttpFieldforContent-Encodingsuitable for this Compression implementation.The filename extensions for this compression implementation.getName()TheHttpFieldforX-Content-Encodingsuitable for this Compression implementation.newDecoderInputStream(InputStream in, DecoderConfig config) Create a newInputStreamto decode (decompress) with this compression implementation.newDecoderSource(Content.Source source, DecoderConfig config) Create a newDecoderSourcefor this compression implementationnewEncoderOutputStream(OutputStream out, EncoderConfig config) Create a newOutputStreamto encode (compress) with this compression implementation.newEncoderSink(Content.Sink sink, EncoderConfig config) Create a newEncoderSinkfor this compression implementationvoidsetDefaultDecoderConfig(DecoderConfig config) voidsetDefaultEncoderConfig(EncoderConfig config) voidsetMinCompressSize(int minCompressSize) Methods inherited from class Compression
doStart, etag, getBufferSize, getByteBufferPool, getContainer, getEncodingName, getEtagSuffix, getMinCompressSize, newDecoderInputStream, newDecoderSource, newEncoderOutputStream, newEncoderSink, setBufferSize, setByteBufferPool, setContainer, stripSuffixesMethods inherited from class 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, updateBeansMethods inherited from class AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Container
getCachedBeans, getEventListenersMethods inherited from interface Dumpable.DumpableContainer
isDumpable 
- 
Constructor Details
- 
ZstandardCompression
public ZstandardCompression() 
 - 
 - 
Method Details
- 
acquireByteBuffer
Description copied from class:CompressionAcquire aRetainableByteBufferthat is managed by thisCompressionimplementation which is suitable for compressed output from anEncoderSinkor 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:
 acquireByteBufferin classCompression- Parameters:
 length- the requested size of the buffer- Returns:
 - the ByteBuffer suitable for this compression implementation.
 
 - 
getContentEncodingField
Description copied from class:CompressionTheHttpFieldforContent-Encodingsuitable for this Compression implementation.- Specified by:
 getContentEncodingFieldin classCompression- Returns:
 - the HttpField for 
Content-Encoding. 
 - 
getDefaultDecoderConfig
- Specified by:
 getDefaultDecoderConfigin classCompression
 - 
setDefaultDecoderConfig
- Specified by:
 setDefaultDecoderConfigin classCompression
 - 
getDefaultEncoderConfig
- Specified by:
 getDefaultEncoderConfigin classCompression
 - 
setDefaultEncoderConfig
- Specified by:
 setDefaultEncoderConfigin classCompression
 - 
getFileExtensionNames
Description copied from class:CompressionThe filename extensions for this compression implementation.Not an exhaustive list, just the most commonly seen extensions.
- Specified by:
 getFileExtensionNamesin 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:
 setMinCompressSizein classCompression
 - 
getName
- Specified by:
 getNamein classCompression- Returns:
 - the name of the compression implementation.
 
 - 
getXContentEncodingField
Description copied from class:CompressionTheHttpFieldforX-Content-Encodingsuitable for this Compression implementation.- Specified by:
 getXContentEncodingFieldin classCompression- Returns:
 - the HttpField for 
X-Content-Encoding. 
 - 
newDecoderInputStream
Description copied from class:CompressionCreate a newInputStreamto decode (decompress) with this compression implementation.- Specified by:
 newDecoderInputStreamin classCompression- Parameters:
 in- the input stream to write the decoded (decompressed) bytes toconfig- theDecoderConfigfor this input stream.- Returns:
 - the 
InputStreamimplementation for this compression. - Throws:
 IOException- if unable to create InputStream
 - 
newDecoderSource
Description copied from class:CompressionCreate a newDecoderSourcefor this compression implementation- Specified by:
 newDecoderSourcein classCompression- Parameters:
 source- the source to write the decoded bytes toconfig- theDecoderConfigfor this source.- Returns:
 - a new 
DecoderSource 
 - 
newEncoderOutputStream
public OutputStream newEncoderOutputStream(OutputStream out, EncoderConfig config) throws IOException Description copied from class:CompressionCreate a newOutputStreamto encode (compress) with this compression implementation.- Specified by:
 newEncoderOutputStreamin classCompression- Parameters:
 out- the output stream to write the encoded (compressed) bytes toconfig- theEncoderConfigfor this output stream.- Returns:
 - the 
OutputStreamimplementation for this compression. - Throws:
 IOException- if unable to create OutputStream
 - 
newEncoderSink
Description copied from class:CompressionCreate a newEncoderSinkfor this compression implementation- Specified by:
 newEncoderSinkin classCompression- Parameters:
 sink- the sink to write the encoded bytes toconfig- theEncoderConfigfor this sink.- Returns:
 - a new 
EncoderSink 
 
 -