InputStream that will use an locator to fetch the
Blob value from the server.
Closing a ByteArrayInputStream has no effect. The methods in
this class can be called after the stream has been closed without
generating an IOException.
This InputStream implementation is pretty basic. No
buffering of data is done. Hence, for efficiency #read(byte[])
should be used instead of #read(). Marks are not supported, but it
should be pretty simple to extend the implementation to support
this. A more efficient skip implementation should also be
straight-forward.
| Modifier and Type | Field and Description |
|---|---|
| private final ClientBlob | blob
The Blob to be accessed. |
| private final ClientConnection | connection
Connection used to read Blob from server. |
| private long | currentPos
Current position in the underlying Blob. |
| private final long | maxPos
Position in Blob where to stop reading. |
| Access | Constructor and Description |
|---|---|
| pack-priv | BlobLocatorInputStream(ClientConnection
connection to be used to read the
connection, ClientBlob Blob value from the serverBlob object that contains locator for
the Blob value on the server.Create an |
| pack-priv | BlobLocatorInputStream(ClientConnection
connection to be used to read the
connection, ClientBlob Blob value from the serverBlob object that contains locator for
the Blob value on the server.the position in the position, long Blob of the first
byte to read.the maximum number of bytes to read from
the length)Blob.Create an |
| Modifier and Type | Method and Description |
|---|---|
| public int | read()
Implements abstract java. |
| public int | read(byte[]
the buffer into which the data is read. b, int the start offset in array off, int b
at which the data is written.the maximum number of bytes to read. len)Overrides java. len bytes of data from the input stream into
an array of bytes.
|
| private byte[] | Returns: byte[] containing the read bytesnumber of bytes to read len)Read the next |
| blob | back to summary |
|---|---|
| private final ClientBlob blob The Blob to be accessed. | |
| connection | back to summary |
|---|---|
| private final ClientConnection connection Connection used to read Blob from server. | |
| currentPos | back to summary |
|---|---|
| private long currentPos Current position in the underlying Blob. Blobs are indexed from 1 | |
| maxPos | back to summary |
|---|---|
| private final long maxPos Position in Blob where to stop reading. maxPos starts counting from 1. | |
| BlobLocatorInputStream | back to summary |
|---|---|
| pack-priv BlobLocatorInputStream(ClientConnection connection, ClientBlob blob) throws SqlException Create an
| |
| BlobLocatorInputStream | back to summary |
|---|---|
| pack-priv BlobLocatorInputStream(ClientConnection connection, ClientBlob blob, long position, long length) throws SqlException Create an
| |
| read | back to summary |
|---|---|
| public int read() throws IOException Implements abstract java. Doc from java. Reads the next byte of data from the input stream. The value byte is
returned as an
| |
| read | back to summary |
|---|---|
| public int read(byte[] b, int off, int len) throws IOException Overrides java. Doc from java. Reads up to This method blocks until input data is available, end of file is detected, or an exception is thrown. If The first byte read is stored into element In every case, elements
| |
| readBytes | back to summary |
|---|---|
| private byte[] readBytes(int len) throws IOException Read the next
| |