Class BrotliEncoderChannel

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

    public class BrotliEncoderChannel
    extends Encoder
    implements java.nio.channels.WritableByteChannel
    WritableByteChannel that wraps native brotli encoder.
    • Constructor Detail

      • BrotliEncoderChannel

        public BrotliEncoderChannel​(java.nio.channels.WritableByteChannel destination,
                                    Encoder.Parameters params,
                                    int bufferSize)
                             throws java.io.IOException
        Creates a BrotliEncoderChannel
        Parameters:
        destination - underlying destination
        params - encoding settings
        bufferSize - intermediate buffer size
        Throws:
        java.io.IOException - If any failure during initialization
      • BrotliEncoderChannel

        public BrotliEncoderChannel​(java.nio.channels.WritableByteChannel destination,
                                    Encoder.Parameters params)
                             throws java.io.IOException
        Creates a BrotliEncoderChannel
        Parameters:
        destination - underlying destination
        params - encoding settings
        Throws:
        java.io.IOException - If any failure during initialization
      • BrotliEncoderChannel

        public BrotliEncoderChannel​(java.nio.channels.WritableByteChannel destination)
                             throws java.io.IOException
        Creates a BrotliEncoderChannel
        Parameters:
        destination - underlying destination
        Throws:
        java.io.IOException - If any failure during initialization
    • Method Detail

      • 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
        Throws:
        java.io.IOException
      • write

        public int write​(java.nio.ByteBuffer src)
                  throws java.io.IOException
        Specified by:
        write in interface java.nio.channels.WritableByteChannel
        Throws:
        java.io.IOException