Class BrotliDecoderChannel

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.nio.channels.Channel, java.nio.channels.ReadableByteChannel

    public class BrotliDecoderChannel
    extends Decoder
    implements java.nio.channels.ReadableByteChannel
    ReadableByteChannel that wraps native brotli decoder.
    • Field Detail

      • DEFAULT_BUFFER_SIZE

        private static final int DEFAULT_BUFFER_SIZE
        The default internal buffer size used by the decoder.
        See Also:
        Constant Field Values
      • mutex

        private final java.lang.Object mutex
    • Constructor Detail

      • BrotliDecoderChannel

        public BrotliDecoderChannel​(java.nio.channels.ReadableByteChannel source,
                                    int bufferSize)
                             throws java.io.IOException
        Creates a BrotliDecoderChannel.
        Parameters:
        source - underlying source
        bufferSize - intermediate buffer size
        customDictionary - initial LZ77 dictionary
        Throws:
        java.io.IOException
      • BrotliDecoderChannel

        public BrotliDecoderChannel​(java.nio.channels.ReadableByteChannel source)
                             throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • attachDictionary

        public void attachDictionary​(java.nio.ByteBuffer dictionary)
                              throws java.io.IOException
        Overrides:
        attachDictionary in class Decoder
        Throws:
        java.io.IOException
      • isOpen

        public boolean isOpen()
        Specified by:
        isOpen in interface java.nio.channels.Channel
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.nio.channels.Channel
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class Decoder
        Throws:
        java.io.IOException
      • read

        public int read​(java.nio.ByteBuffer dst)
                 throws java.io.IOException
        Specified by:
        read in interface java.nio.channels.ReadableByteChannel
        Throws:
        java.io.IOException