Class AbstractStreamableObject.StreamableObjectInputStream

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

    class AbstractStreamableObject.StreamableObjectInputStream
    extends PagedInputStream
    An InputStream that is used to read the data from the streamable object as a basic byte encoding. This maintains an internal buffer.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int B_SIZE
      The default size of the buffer.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void readPageContent​(byte[] buf, long pos, int length)
      Reads the page at the given offset in the underlying data into the given byte[] array.
      • Methods inherited from class java.io.InputStream

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

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

      • B_SIZE

        private static final int B_SIZE
        The default size of the buffer.
        See Also:
        Constant Field Values
    • Constructor Detail

      • StreamableObjectInputStream

        public StreamableObjectInputStream​(long in_size)
        Construct the input stream.
    • Method Detail

      • readPageContent

        protected void readPageContent​(byte[] buf,
                                       long pos,
                                       int length)
                                throws java.io.IOException
        Description copied from class: PagedInputStream
        Reads the page at the given offset in the underlying data into the given byte[] array. The 'pos' variable given is guarenteed to be a multiple of buffer_size. For example, the first access will be to pos = 0, the second access to pos = BUFFER_SIZE, the third access to pos = BUFFER_SIZE * 2, etc. 'length' will always be either BUFFER_SIZE or a value smaller than BUFFER_SIZE if the page containing the end of the stream is read.
        Specified by:
        readPageContent in class PagedInputStream
        Throws:
        java.io.IOException