Class DbInputStream

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

    public class DbInputStream
    extends AutoCloseInputStream
    This class represents an input stream backed by a database. The database objects are only acquired when reading from the stream, and stay open until the stream is closed, fully read, or garbage collected.

    This class does not support mark/reset. It is always to be wrapped using a BufferedInputStream.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int available()
      void close()
      When the stream is consumed, the database objects held by the instance are closed.
      void mark​(int readlimit)
      This method does nothing.
      boolean markSupported()
      Check whether mark and reset are supported.
      int read()
      When the stream is consumed, the database objects held by the instance are closed.
      int read​(byte[] b)
      When the stream is consumed, the database objects held by the instance are closed.
      int read​(byte[] b, int off, int len)
      When the stream is consumed, the database objects held by the instance are closed.
      void reset()
      This method does nothing.
      long skip​(long n)
      • Methods inherited from class java.io.InputStream

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

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • read

        public int read()
                 throws java.io.IOException
        When the stream is consumed, the database objects held by the instance are closed.
        Overrides:
        read in class ProxyInputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b)
                 throws java.io.IOException
        When the stream is consumed, the database objects held by the instance are closed.
        Overrides:
        read in class ProxyInputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        When the stream is consumed, the database objects held by the instance are closed.
        Overrides:
        read in class ProxyInputStream
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        When the stream is consumed, the database objects held by the instance are closed.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class AutoCloseInputStream
        Throws:
        java.io.IOException
      • skip

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

        public int available()
                      throws java.io.IOException
        Overrides:
        available in class ProxyInputStream
        Throws:
        java.io.IOException
      • mark

        public void mark​(int readlimit)
        This method does nothing.
        Overrides:
        mark in class ProxyInputStream
      • reset

        public void reset()
                   throws java.io.IOException
        This method does nothing.
        Overrides:
        reset in class ProxyInputStream
        Throws:
        java.io.IOException
      • markSupported

        public boolean markSupported()
        Check whether mark and reset are supported.
        Overrides:
        markSupported in class ProxyInputStream
        Returns:
        false