public final class BlobProxy extends Object implements Blob, BlobImplementer
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 | Method and Description |
---|---|
void |
free() |
static Blob |
generateProxy(byte[] bytes)
Generates a BlobImpl using byte data.
|
static Blob |
generateProxy(InputStream stream,
long length)
Generates a BlobImpl proxy using a given number of bytes from an InputStream.
|
InputStream |
getBinaryStream() |
InputStream |
getBinaryStream(long start,
long length) |
byte[] |
getBytes(long start,
int length) |
BinaryStream |
getUnderlyingStream()
Gets access to the data underlying this BLOB.
|
long |
length() |
long |
position(Blob pattern,
long start) |
long |
position(byte[] pattern,
long start) |
OutputStream |
setBinaryStream(long pos) |
int |
setBytes(long pos,
byte[] bytes) |
int |
setBytes(long pos,
byte[] bytes,
int offset,
int len) |
void |
truncate(long len) |
public BinaryStream getUnderlyingStream() throws SQLException
BlobImplementer
getUnderlyingStream
in interface BlobImplementer
SQLException
public static Blob generateProxy(byte[] bytes)
bytes
- The data to be created as a Blob.public static Blob generateProxy(InputStream stream, long length)
stream
- The input stream of bytes to be created as a Blob.length
- The number of bytes from stream to be written to the Blob.public long length() throws SQLException
length
in interface Blob
SQLException
public byte[] getBytes(long start, int length) throws SQLException
getBytes
in interface Blob
SQLException
public InputStream getBinaryStream() throws SQLException
getBinaryStream
in interface Blob
SQLException
public int setBytes(long pos, byte[] bytes, int offset, int len)
public OutputStream setBinaryStream(long pos)
setBinaryStream
in interface Blob
public InputStream getBinaryStream(long start, long length) throws SQLException
getBinaryStream
in interface Blob
SQLException
Copyright © 2001-2022 Red Hat, Inc. All Rights Reserved.