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