Package net.sourceforge.jtds.util
Class BlobBuffer.AsciiInputStream
java.lang.Object
java.io.InputStream
net.sourceforge.jtds.util.BlobBuffer.AsciiInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
BlobBuffer
An ASCII
InputStream over the CLOB buffer.
This class interprets ASCII as anything which has a value below 0x80.
This is more rigid than other drivers which allow any character below
0x100 to be converted to returned. The more relaxed coding is useful
when dealing with most single byte character sets and if this behaviour
is desired, comment out the line indicated in the read method.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAsciiInputStream(long pos) Costructs an InputStream object over the BLOB buffer. -
Method Summary
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
readPtr
private int readPtr -
open
private boolean open
-
-
Constructor Details
-
AsciiInputStream
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
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
Read 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
-
close
Closes the output stream.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException- if an I/O error occurs
-