Class CompressExtension

  • All Implemented Interfaces:
    org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.LifeCycle, org.eclipse.jetty.websocket.api.extensions.Extension, org.eclipse.jetty.websocket.api.extensions.IncomingFrames, org.eclipse.jetty.websocket.api.extensions.OutgoingFrames
    Direct Known Subclasses:
    DeflateFrameExtension, PerMessageDeflateExtension

    public abstract class CompressExtension
    extends AbstractExtension
    • Field Detail

      • TAIL_BYTES

        protected static final byte[] TAIL_BYTES
      • TAIL_BYTES_BUF

        protected static final ByteBuffer TAIL_BYTES_BUF
      • TAIL_DROP_NEVER

        protected static final int TAIL_DROP_NEVER
        Never drop tail bytes 0000FFFF, from any frame type
        See Also:
        Constant Field Values
      • TAIL_DROP_ALWAYS

        protected static final int TAIL_DROP_ALWAYS
        Always drop tail bytes 0000FFFF, from all frame types
        See Also:
        Constant Field Values
      • TAIL_DROP_FIN_ONLY

        protected static final int TAIL_DROP_FIN_ONLY
        Only drop tail bytes 0000FFFF, from fin==true frames
        See Also:
        Constant Field Values
      • RSV_USE_ALWAYS

        protected static final int RSV_USE_ALWAYS
        Always set RSV flag, on all frame types
        See Also:
        Constant Field Values
      • RSV_USE_ONLY_FIRST

        protected static final int RSV_USE_ONLY_FIRST
        Only set RSV flag on first frame in multi-frame messages.

        Note: this automatically means no-continuation frames have the RSV bit set

        See Also:
        Constant Field Values
      • INFLATE_BUFFER_SIZE

        protected static final int INFLATE_BUFFER_SIZE
        Inflater / Decompressed Buffer Size
        See Also:
        Constant Field Values
      • INPUT_MAX_BUFFER_SIZE

        protected static final int INPUT_MAX_BUFFER_SIZE
        Deflater / Inflater: Maximum Input Buffer Size
        See Also:
        Constant Field Values
    • Constructor Detail

      • CompressExtension

        protected CompressExtension()
    • Method Detail

      • getDeflater

        public Deflater getDeflater()
      • getInflater

        public Inflater getInflater()
      • isRsv1User

        public boolean isRsv1User()
        Indicates use of RSV1 flag for indicating deflation is in use.
        Specified by:
        isRsv1User in interface org.eclipse.jetty.websocket.api.extensions.Extension
        Overrides:
        isRsv1User in class AbstractExtension
        Returns:
        true if extension uses RSV1 for its own purposes.
      • forwardIncoming

        protected void forwardIncoming​(org.eclipse.jetty.websocket.api.extensions.Frame frame,
                                       ByteAccumulator accumulator)
      • outgoingFrame

        public void outgoingFrame​(org.eclipse.jetty.websocket.api.extensions.Frame frame,
                                  org.eclipse.jetty.websocket.api.WriteCallback callback,
                                  org.eclipse.jetty.websocket.api.BatchMode batchMode)
      • notifyCallbackSuccess

        protected void notifyCallbackSuccess​(org.eclipse.jetty.websocket.api.WriteCallback callback)
      • notifyCallbackFailure

        protected void notifyCallbackFailure​(org.eclipse.jetty.websocket.api.WriteCallback callback,
                                             Throwable failure)
      • endsWithTail

        public static boolean endsWithTail​(ByteBuffer buf)
      • doStop

        protected void doStop()
                       throws Exception
        Overrides:
        doStop in class org.eclipse.jetty.util.component.AbstractLifeCycle
        Throws:
        Exception