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:
available
in classInputStream
- Throws:
IOException
- if an I/O error occurs
-
read
Read the next byte from the stream.- Specified by:
read
in classInputStream
- Returns:
- the next byte as an
int
or -1 if at EOF - Throws:
IOException
- if an I/O error occurs
-
close
Closes the output stream.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
- if an I/O error occurs
-