Class BlobStore.BLOBInputStream

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

    private class BlobStore.BLOBInputStream
    extends PagedInputStream
    An InputStream implementation that reads from the underlying blob data as fixed size pages.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static int B_SIZE  
      private long reference_id  
    • Constructor Summary

      Constructors 
      Constructor Description
      BLOBInputStream​(long reference_id, long size)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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
    • Constructor Detail

      • BLOBInputStream

        public BLOBInputStream​(long reference_id,
                               long size)
    • Method Detail

      • readPageContent

        public 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