Blob objects.
In previous versions this used to be implemented by using a java.lang.reflect.Proxy to deal with
incompatibilities across various JDBC versions, hence the class name, but using a real Proxy is no longer necessary.
The class name could be updated to reflect this but that would break APIs, so this operation is deferred.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final BinaryStream | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| private | |
| private | BlobProxy(InputStream
The binary stream stream, long The length of the stream length)Constructor used to build |
| Modifier and Type | Method and Description |
|---|---|
| public void | free()
Implements java. Blob object and releases the resources that
it holds.
|
| public static Blob | Returns: The BlobProxy instance to represent this data.The data to be created as a Blob. bytes)Generates a BlobImpl using byte data. |
| public static Blob | Returns: The BlobProxy instance to represent this data.The input stream of bytes to be created as a Blob. stream, long The number of bytes from stream to be written to the Blob. length)Generates a BlobImpl proxy using a given number of bytes from an InputStream. |
| public InputStream | getBinaryStream()
Implements java. BLOB value designated by this
Blob instance as a stream.
|
| public InputStream | getBinaryStream(final long
the offset to the first byte of the partial value to be
retrieved. The first byte in the start, final long Blob is at position 1.the length in bytes of the partial value to be retrieved length)Implements java. InputStream object that contains
a partial Blob value, starting with the byte
specified by pos, which is length bytes in length.
|
| public byte[] | getBytes(final long
the ordinal position of the first byte in the
start, final int BLOB value to be extracted; the first byte is at
position 1the number of consecutive bytes to be copied; the value
for length must be 0 or greater length)Implements java. BLOB
value that this Blob object represents, as an array of
bytes.
|
| private InputStream | |
| public BinaryStream | getUnderlyingStream()
Implements org. |
| public long | length()
Implements java. BLOB value
designated by this Blob object.
|
| private static UnsupportedOperationException | |
| public long | position(byte[]
the byte array for which to search pattern, long the position at which to begin searching; the
first position is 1 start)Implements java. pattern begins within the BLOB
value that this Blob object represents.
|
| public long | position(Blob
the pattern, long Blob object designating
the BLOB value for which to searchthe position in the start)BLOB value
at which to begin searching; the first position is 1Implements java. BLOB value
designated by this Blob object at which
pattern begins.
|
| private void | |
| public OutputStream | setBinaryStream(long
the position in the pos)BLOB value at which
to start writing; the first position is 1Implements java. BLOB
value that this Blob object represents.
|
| public int | setBytes(long
the position in the pos, byte[] BLOB object at which
to start writing; the first position is 1the array of bytes to be written to the bytes)BLOB
value that this Blob object representsImplements java. BLOB value that
this Blob object represents, starting at position
pos, and returns the number of bytes written.
|
| public int | setBytes(long
the position in the pos, byte[] BLOB object at which
to start writing; the first position is 1the array of bytes to be written to this bytes, int BLOB
objectthe offset into the array offset, int bytes at which
to start reading the bytes to be setthe number of bytes to be written to the len)BLOB
value from the array of bytes bytesImplements java. byte array to the
BLOB value that this Blob object represents
and returns the number of bytes written.
|
| public void | truncate(long
the length, in bytes, to which the len)BLOB value
that this Blob object represents should be truncatedImplements java. BLOB value that this Blob
object represents to be len bytes in length.
|
| binaryStream | back to summary |
|---|---|
| private final BinaryStream binaryStream | |
| needsReset | back to summary |
|---|---|
| private boolean needsReset | |
| BlobProxy | back to summary |
|---|---|
| private BlobProxy(byte[] bytes) Constructor used to build
| |
| BlobProxy | back to summary |
|---|---|
| private BlobProxy(InputStream stream, long length) Constructor used to build
| |
| free | back to summary |
|---|---|
| public void free() Implements java. Doc from java. This method frees the
After
| |
| generateProxy | back to summary |
|---|---|
| public static Blob generateProxy(byte[] bytes) Generates a BlobImpl using byte data.
| |
| generateProxy | back to summary |
|---|---|
| public static Blob generateProxy(InputStream stream, long length) Generates a BlobImpl proxy using a given number of bytes from an InputStream.
| |
| getBinaryStream | back to summary |
|---|---|
| public InputStream getBinaryStream() throws SQLException Implements java. Doc from java. Retrieves the
| |
| getBinaryStream | back to summary |
|---|---|
| public InputStream getBinaryStream(final long start, final long length) throws SQLException Implements java. Doc from java. Returns an
| |
| getBytes | back to summary |
|---|---|
| public byte[] getBytes(final long start, final int length) throws SQLException Implements java. Doc from java. Retrieves all or part of the
| |
| getStream | back to summary |
|---|---|
| private InputStream getStream() throws SQLException | |
| getUnderlyingStream | back to summary |
|---|---|
| public BinaryStream getUnderlyingStream() throws SQLException Implements org. Doc from org. Gets access to the data underlying this BLOB.
| |
| length | back to summary |
|---|---|
| public long length() throws SQLException Implements java. Doc from java. Returns the number of bytes in the
| |
| notSupported | back to summary |
|---|---|
| private static UnsupportedOperationException notSupported() | |
| position | back to summary |
|---|---|
| public long position(byte[] pattern, long start) Implements java. Doc from java. Retrieves the byte position at which the specified byte array
| |
| position | back to summary |
|---|---|
| public long position(Blob pattern, long start) Implements java. Doc from java. Retrieves the byte position in the | |
| resetIfNeeded | back to summary |
|---|---|
| private void resetIfNeeded() throws SQLException | |
| setBinaryStream | back to summary |
|---|---|
| public OutputStream setBinaryStream(long pos) Implements java. Doc from java. Retrieves a stream that can be used to write to the Note If the value specified for
| |
| setBytes | back to summary |
|---|---|
| public int setBytes(long pos, byte[] bytes) Implements java. Doc from java. Writes the given array of bytes to the Note If the value specified for
| |
| setBytes | back to summary |
|---|---|
| public int setBytes(long pos, byte[] bytes, int offset, int len) Implements java. Doc from java. Writes all or part of the given Note If the value specified for
| |
| truncate | back to summary |
|---|---|
| public void truncate(long len) Implements java. Doc from java. Truncates the Note If the value specified for
| |
| Modifier and Type | Field and Description |
|---|---|
| private byte[] | |
| private final long | |
| private final InputStream |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public byte[] | |
| public InputStream | getInputStream()
Implements org. |
| public long | getLength()
Implements org. |
| public void | release()
Implements org. |
| bytes | back to summary |
|---|---|
| private byte[] bytes | |
| length | back to summary |
|---|---|
| private final long length | |
| stream | back to summary |
|---|---|
| private final InputStream stream | |
| StreamBackedBinaryStream | back to summary |
|---|---|
| private StreamBackedBinaryStream(InputStream stream, long length) | |
| getBytes | back to summary |
|---|---|
| public byte[] getBytes() Implements org. Doc from org. Access to the bytes.
| |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream() Implements org. Doc from org. Retrieve the input stream.
| |
| getLength | back to summary |
|---|---|
| public long getLength() Implements org. Doc from org. Retrieve the length of the input stream
| |
| release | back to summary |
|---|---|
| public void release() Implements org. Doc from org. Release any underlying resources.
| |