Class BrotliInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class BrotliInputStream
    extends java.io.InputStream
    InputStream that wraps native brotli decoder.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Decoder decoder  
      private static int DEFAULT_BUFFER_SIZE
      The default internal buffer size used by the decoder.
    • Constructor Summary

      Constructors 
      Constructor Description
      BrotliInputStream​(java.io.InputStream source)  
      BrotliInputStream​(java.io.InputStream source, int bufferSize)
      Creates a BrotliInputStream.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void attachDictionary​(java.nio.ByteBuffer dictionary)  
      int available()  
      void close()  
      void enableEagerOutput()  
      int read()  
      int read​(byte[] b)  
      int read​(byte[] b, int off, int len)  
      long skip​(long n)  
      • Methods inherited from class java.io.InputStream

        mark, markSupported, reset
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
      • decoder

        private final Decoder decoder
    • Constructor Detail

      • BrotliInputStream

        public BrotliInputStream​(java.io.InputStream source,
                                 int bufferSize)
                          throws java.io.IOException
        Creates a BrotliInputStream.
        Parameters:
        source - underlying source
        bufferSize - intermediate buffer size
        Throws:
        java.io.IOException
      • BrotliInputStream

        public BrotliInputStream​(java.io.InputStream source)
                          throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • attachDictionary

        public void attachDictionary​(java.nio.ByteBuffer dictionary)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • enableEagerOutput

        public void enableEagerOutput()
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.InputStream
        Throws:
        java.io.IOException
      • available

        public int available()
        Overrides:
        available in class java.io.InputStream
      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • skip

        public long skip​(long n)
                  throws java.io.IOException
        Overrides:
        skip in class java.io.InputStream
        Throws:
        java.io.IOException