类 BlobProxy
- java.lang.Object
-
- org.hibernate.engine.jdbc.BlobProxy
-
- 所有已实现的接口:
Blob,BlobImplementer
public final class BlobProxy extends Object implements Blob, BlobImplementer
Manages aspects of representingBlobobjects. 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.- 作者:
- Gavin King, Steve Ebersole, Gail Badner, Sanne Grinovero
-
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 voidfree()static BlobgenerateProxy(byte[] bytes)Generates a BlobImpl using byte data.static BlobgenerateProxy(InputStream stream, long length)Generates a BlobImpl proxy using a given number of bytes from an InputStream.InputStreamgetBinaryStream()InputStreamgetBinaryStream(long start, long length)byte[]getBytes(long start, int length)BinaryStreamgetUnderlyingStream()Gets access to the data underlying this BLOB.longlength()longposition(byte[] pattern, long start)longposition(Blob pattern, long start)OutputStreamsetBinaryStream(long pos)intsetBytes(long pos, byte[] bytes)intsetBytes(long pos, byte[] bytes, int offset, int len)voidtruncate(long len)
-
-
-
方法详细资料
-
getUnderlyingStream
public BinaryStream getUnderlyingStream() throws SQLException
从接口复制的说明:BlobImplementerGets access to the data underlying this BLOB.- 指定者:
getUnderlyingStream在接口中BlobImplementer- 返回:
- Access to the underlying data.
- 抛出:
SQLException
-
generateProxy
public static Blob generateProxy(byte[] bytes)
Generates a BlobImpl using byte data.- 参数:
bytes- The data to be created as a Blob.- 返回:
- The BlobProxy instance to represent this data.
-
generateProxy
public static Blob generateProxy(InputStream stream, long length)
Generates a BlobImpl proxy using a given number of bytes from an InputStream.- 参数:
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.- 返回:
- The BlobProxy instance to represent this data.
-
length
public long length() throws SQLException- 指定者:
length在接口中Blob- 抛出:
SQLException
-
getBytes
public byte[] getBytes(long start, int length) throws SQLException- 指定者:
getBytes在接口中Blob- 抛出:
SQLException
-
getBinaryStream
public InputStream getBinaryStream() throws SQLException
- 指定者:
getBinaryStream在接口中Blob- 抛出:
SQLException
-
setBinaryStream
public OutputStream setBinaryStream(long pos)
- 指定者:
setBinaryStream在接口中Blob
-
getBinaryStream
public InputStream getBinaryStream(long start, long length) throws SQLException
- 指定者:
getBinaryStream在接口中Blob- 抛出:
SQLException
-
-