public class BlobLocatorInputStream extends InputStream
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 efficieny #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.
| Constructor and Description |
|---|
BlobLocatorInputStream(Connection connection,
Blob blob)
Create an
InputStream for reading the
Blob value represented by the given locator based
Blob object. |
BlobLocatorInputStream(Connection connection,
Blob blob,
long position,
long length)
Create an
InputStream for reading the
Blob value represented by the given locator based
Blob object. |
| Modifier and Type | Method and Description |
|---|---|
int |
read() |
int |
read(byte[] b,
int off,
int len) |
available, close, mark, markSupported, read, reset, skippublic BlobLocatorInputStream(Connection connection, Blob blob) throws SqlException
InputStream for reading the
Blob value represented by the given locator based
Blob object.connection - connection to be used to read the
Blob value from the serverblob - Blob object that contains locator for
the Blob value on the server.SqlException - if an error occurs when obtaining the
length of the Blob.public BlobLocatorInputStream(Connection connection, Blob blob, long position, long length) throws SqlException
InputStream for reading the
Blob value represented by the given locator based
Blob object.connection - connection to be used to read the
Blob value from the serverblob - Blob object that contains locator for
the Blob value on the server.position - the position in the Blob of the first
byte to read.length - the maximum number of bytes to read from
the Blob.SqlException - if an error occurs when obtaining the
length of the Blob.public int read()
throws IOException
read in class InputStreamIOExceptionThis method fetches one byte at a time from the server. For more
efficient retrieval, use #read(byte[]).public int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionInputStream.read(byte[], int, int)Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.