Class BlockingInputStream

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

    public class BlockingInputStream
    extends java.io.InputStream
    The Class BlockingInputStream.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.io.InputStream is
      The stream.
    • Constructor Summary

      Constructors 
      Constructor Description
      BlockingInputStream​(java.io.InputStream is)
      Instantiates a new blocking input stream.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int available()  
      void close()  
      void mark​(int readLimit)  
      boolean markSupported()  
      int read()  
      int read​(byte[] bf)
      Blocking Read.
      int read​(byte[] bf, int s, int l)  
      void reset()  
      long skip​(long n)  
      • 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
    • Field Detail

      • is

        protected java.io.InputStream is
        The stream.
    • Constructor Detail

      • BlockingInputStream

        public BlockingInputStream​(java.io.InputStream is)
        Instantiates a new blocking input stream.
        Parameters:
        is - the is
    • Method Detail

      • available

        public int available()
                      throws java.io.IOException
        Overrides:
        available in class java.io.InputStream
        Throws:
        java.io.IOException
        See Also:
        InputStream.available()
      • 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
        See Also:
        InputStream.close()
      • mark

        public void mark​(int readLimit)
        Overrides:
        mark in class java.io.InputStream
        See Also:
        InputStream.mark(int)
      • markSupported

        public boolean markSupported()
        Overrides:
        markSupported in class java.io.InputStream
        See Also:
        InputStream.markSupported()
      • read

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

        public int read​(byte[] bf)
                 throws java.io.IOException
        Blocking Read.
        Overrides:
        read in class java.io.InputStream
        Parameters:
        bf - the buffer to fill
        Returns:
        the number of read bytes or -1 if the end of the stream is reached.
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
        See Also:
        InputStream.read(byte[])
      • read

        public int read​(byte[] bf,
                        int s,
                        int l)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
        See Also:
        InputStream.read(byte[], int, int)
      • reset

        public void reset()
                   throws java.io.IOException
        Overrides:
        reset in class java.io.InputStream
        Throws:
        java.io.IOException
        See Also:
        InputStream.reset()
      • skip

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