Class BufferInputStream

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

    public final class BufferInputStream
    extends java.io.InputStream
    Very similar to the java.io.ByteArrayInputStream but this version is not thread safe.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) byte[] buffer  
      (package private) int limit  
      (package private) int mark  
      (package private) int pos  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int available()  
      void mark​(int markpos)  
      boolean markSupported()  
      int read()  
      int read​(byte[] b)  
      int read​(byte[] b, int off, int len)  
      Buffer readBuffer​(int len)  
      void reset()  
      long skip​(long len)  
      • Methods inherited from class java.io.InputStream

        close
      • Methods inherited from class java.lang.Object

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

      • buffer

        byte[] buffer
      • limit

        int limit
      • pos

        int pos
      • mark

        int mark
    • Constructor Detail

      • BufferInputStream

        public BufferInputStream​(byte[] data)
      • BufferInputStream

        public BufferInputStream​(Buffer sequence)
      • BufferInputStream

        public BufferInputStream​(byte[] data,
                                 int offset,
                                 int size)
    • Method Detail

      • 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)
        Overrides:
        read in class java.io.InputStream
      • readBuffer

        public Buffer readBuffer​(int len)
      • skip

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

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

        public boolean markSupported()
        Overrides:
        markSupported in class java.io.InputStream
      • mark

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

        public void reset()
        Overrides:
        reset in class java.io.InputStream