Class DeflateInputStream

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

    public class DeflateInputStream
    extends java.io.InputStream
    Deflate input stream. This class takes logic from HttpComponents HttpClient 4.2.x that really should have been exposed as an independent input stream wrapper, and does it the right way. I will also open an HttpClient ticket so that this code can be pushed upstream eventually.
    • Constructor Summary

      Constructors 
      Constructor Description
      DeflateInputStream​(java.io.InputStream wrapped)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int available()
      Get available.
      void close()
      Close.
      void mark​(int readLimit)
      Mark.
      boolean markSupported()
      Check if mark is supported.
      int read()
      Read a byte.
      int read​(byte[] b)
      Read lots of bytes.
      int read​(byte[] b, int off, int len)
      Read lots of specific bytes.
      void reset()
      Reset.
      long skip​(long n)
      Skip
      • Methods inherited from class java.io.InputStream

        nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DeflateInputStream

        public DeflateInputStream​(java.io.InputStream wrapped)
                           throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • read

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

        public int read​(byte[] b)
                 throws java.io.IOException
        Read lots of bytes.
        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
        Read lots of specific bytes.
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • skip

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

        public int available()
                      throws java.io.IOException
        Get available.
        Overrides:
        available in class java.io.InputStream
        Throws:
        java.io.IOException
      • mark

        public void mark​(int readLimit)
        Mark.
        Overrides:
        mark in class java.io.InputStream
      • reset

        public void reset()
                   throws java.io.IOException
        Reset.
        Overrides:
        reset in class java.io.InputStream
        Throws:
        java.io.IOException
      • markSupported

        public boolean markSupported()
        Check if mark is supported.
        Overrides:
        markSupported in class java.io.InputStream
      • close

        public void close()
                   throws java.io.IOException
        Close.
        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