Class BlobBuffer.BlobInputStream

java.lang.Object
java.io.InputStream
net.sourceforge.jtds.util.BlobBuffer.BlobInputStream
All Implemented Interfaces:
Closeable, AutoCloseable
Enclosing class:
BlobBuffer

private class BlobBuffer.BlobInputStream extends InputStream
An InputStream over the BLOB buffer.
  • Field Details

    • readPtr

      private int readPtr
    • open

      private boolean open
  • Constructor Details

    • BlobInputStream

      public BlobInputStream(long pos) throws IOException
      Costructs an InputStream object over the BLOB buffer.
      Parameters:
      pos - the starting position (from 0)
      Throws:
      IOException - if an I/O error occurs
  • Method Details

    • finalize

      protected void finalize() throws Throwable
      Ensures underlying BLOB file can be closed even if user does not close this stream.
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • available

      public int available() throws IOException
      Returns the number of bytes available to read.
      Overrides:
      available in class InputStream
      Throws:
      IOException - if an I/O error occurs
    • read

      public int read() throws IOException
      Reads the next byte from the stream.
      Specified by:
      read in class InputStream
      Returns:
      the next byte as an int or -1 if at EOF
      Throws:
      IOException - if an I/O error occurs
    • read

      public int read(byte[] bytes, int offset, int len) throws IOException
      Reads a bytes from the stream.
      Overrides:
      read in class InputStream
      Parameters:
      bytes - the byte array to fill
      offset - the start position in the byte array
      len - the number of bytes to read
      Returns:
      the number of bytes read or -1 if at end of file
      Throws:
      IOException - if an I/O error occurs
    • close

      public void close() throws IOException
      Closes the output stream.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class InputStream
      Throws:
      IOException - if an I/O error occurs