Package net.sourceforge.jtds.util
Class BlobBuffer.BlobInputStream
- java.lang.Object
-
- java.io.InputStream
-
- net.sourceforge.jtds.util.BlobBuffer.BlobInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Enclosing class:
- BlobBuffer
private class BlobBuffer.BlobInputStream extends java.io.InputStreamAnInputStreamover the BLOB buffer.
-
-
Constructor Summary
Constructors Constructor Description BlobInputStream(long pos)Costructs anInputStreamobject over the BLOB buffer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()Returns the number of bytes available to read.voidclose()Closes the output stream.protected voidfinalize()Ensures underlying BLOB file can be closed even if user does not close this stream.intread()Reads the next byte from the stream.intread(byte[] bytes, int offset, int len)Reads a bytes from the stream.
-
-
-
Method Detail
-
finalize
protected void finalize() throws java.lang.ThrowableEnsures underlying BLOB file can be closed even if user does not close this stream.- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
available
public int available() throws java.io.IOExceptionReturns the number of bytes available to read.- Overrides:
availablein classjava.io.InputStream- Throws:
java.io.IOException- if an I/O error occurs
-
read
public int read() throws java.io.IOExceptionReads the next byte from the stream.- Specified by:
readin classjava.io.InputStream- Returns:
- the next byte as an
intor -1 if at EOF - Throws:
java.io.IOException- if an I/O error occurs
-
read
public int read(byte[] bytes, int offset, int len) throws java.io.IOExceptionReads a bytes from the stream.- Overrides:
readin classjava.io.InputStream- Parameters:
bytes- the byte array to filloffset- the start position in the byte arraylen- the number of bytes to read- Returns:
- the number of bytes read or -1 if at end of file
- Throws:
java.io.IOException- if an I/O error occurs
-
close
public void close() throws java.io.IOExceptionCloses the output stream.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException- if an I/O error occurs
-
-