|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
org.apache.derby.impl.drda.EXTDTAReaderInputStream
org.apache.derby.impl.drda.StandardEXTDTAReaderInputStream
final class StandardEXTDTAReaderInputStream
Implementation of InputStream which get EXTDTA from the DDMReader. This class can be used to stream LOBs from Network client to the Network server.
Field Summary | |
---|---|
private java.io.ByteArrayInputStream |
currentBuffer
Current data buffer |
private long |
length
Length of stream |
private DDMReader |
reader
DDMReader. |
private long |
remainingBytes
Remaining bytes in stream |
Fields inherited from class org.apache.derby.impl.drda.EXTDTAReaderInputStream |
---|
isLayerBStream, readStatusByte |
Constructor Summary | |
---|---|
StandardEXTDTAReaderInputStream(DDMReader reader,
boolean readStatusByte)
Constructor. |
Method Summary | |
---|---|
int |
available()
Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. |
(package private) long |
getLength()
Returns the number of bytes returned by this stream. |
private void |
nextBuffer()
Fetches the next buffer. |
protected void |
onClientSideStreamingError()
Cleans up and closes the stream. |
int |
read()
Reads the next byte of data from the input stream. |
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes of data from the input stream into
an array of bytes. |
Methods inherited from class org.apache.derby.impl.drda.EXTDTAReaderInputStream |
---|
checkStatus, getStatus, isLayerBStream, isStatusSet, setSuppressException, throwEXTDTATransferException |
Methods inherited from class java.io.InputStream |
---|
close, mark, markSupported, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final long length
private final DDMReader reader
private long remainingBytes
private java.io.ByteArrayInputStream currentBuffer
Constructor Detail |
---|
StandardEXTDTAReaderInputStream(DDMReader reader, boolean readStatusByte) throws DRDAProtocolException
reader
- The reader to get data fromreadStatusByte
- whether or not to read the trailing Derby-specific
EXTDTA stream status byte
DRDAProtocolException
- if thrown while initializing current
buffer.Method Detail |
---|
public final int read() throws java.io.IOException
This subclass of InputStream implements this method by reading the next byte from the current buffer. If there is more data, it will be requested a new buffer from the DDMReader.
read
in class java.io.InputStream
-1
if the end of the
stream is reached.
java.io.IOException
- if an I/O error occurs.InputStream.read()
public final int read(byte[] b, int off, int len) throws java.io.IOException
len
bytes of data from the input stream into
an array of bytes. An attempt is made to read as many as
len
bytes, but a smaller number may be read, possibly
zero. The number of bytes actually read is returned as an integer.
This subclass implements this method by calling this method on the
current buffer, which is an instance of ByteArrayInputStream. If the
current buffer does not have any data, it will be requested a new
buffer from the DDMReader.
read
in class java.io.InputStream
b
- the buffer into which the data is read.off
- the start offset in array b
at which the data is written.len
- the maximum number of bytes to read.
-1
if there is no more data because the end of
the stream has been reached.
java.io.IOException
- if an I/O error occurs.
java.lang.NullPointerException
- if b
is null
.InputStream.read(byte[], int, int)
public final int available()
This subclass implements this method by calling available on the current buffer, which is a ByteInputStreamReader.
available
in class java.io.InputStream
final long getLength()
The length includes data which has been already read at the invocation time, but doesn't include any meta data (like the Derby-specific EXTDTA status byte).
private void nextBuffer() throws java.io.IOException
java.io.IOException
- if fetching the buffer failsprotected void onClientSideStreamingError()
onClientSideStreamingError
in class EXTDTAReaderInputStream
|
Built on Thu 2010-12-23 20:49:13+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |