Package net.sourceforge.jtds.util
Class BlobBuffer.BlobInputStream
java.lang.Object
java.io.InputStream
net.sourceforge.jtds.util.BlobBuffer.BlobInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
BlobBuffer
An
InputStream over the BLOB buffer.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBlobInputStream(long pos) Costructs anInputStreamobject over the BLOB buffer. -
Method Summary
Modifier and TypeMethodDescriptionintReturns 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.Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
readPtr
private int readPtr -
open
private boolean open
-
-
Constructor Details
-
BlobInputStream
Costructs anInputStreamobject over the BLOB buffer.- Parameters:
pos- the starting position (from 0)- Throws:
IOException- if an I/O error occurs
-
-
Method Details
-
finalize
Ensures underlying BLOB file can be closed even if user does not close this stream. -
available
Returns the number of bytes available to read.- Overrides:
availablein classInputStream- Throws:
IOException- if an I/O error occurs
-
read
Reads the next byte from the stream.- Specified by:
readin classInputStream- Returns:
- the next byte as an
intor -1 if at EOF - Throws:
IOException- if an I/O error occurs
-
read
Reads a bytes from the stream.- Overrides:
readin classInputStream- 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:
IOException- if an I/O error occurs
-
close
Closes the output stream.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException- if an I/O error occurs
-