Class DataHead.ReadMultiStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    DataHead.ReadOnceStream
    Enclosing class:
    DataHead

    class DataHead.ReadMultiStream
    extends java.io.InputStream
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) byte[] buf  
      (package private) boolean closed  
      (package private) Chunk current  
      (package private) int len  
      (package private) int offset  
    • Constructor Summary

      Constructors 
      Constructor Description
      ReadMultiStream()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void adjustInMemoryUsage()  
      void close()  
      private boolean fetch()
      Gets to the next chunk if we are done with the current one.
      int read()  
      int read​(byte[] b, int off, int sz)  
      • Methods inherited from class java.io.InputStream

        available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

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

      • offset

        int offset
      • len

        int len
      • buf

        byte[] buf
      • closed

        boolean closed
    • Constructor Detail

      • ReadMultiStream

        public ReadMultiStream()
    • Method Detail

      • read

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

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

        void adjustInMemoryUsage()
      • fetch

        private boolean fetch()
                       throws java.io.IOException
        Gets to the next chunk if we are done with the current one.
        Returns:
        true if any data available
        Throws:
        java.io.IOException - when i/o error
      • 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