类 Blob
- java.lang.Object
-
- com.mysql.cj.jdbc.Blob
-
- 所有已实现的接口:
OutputStreamWatcher,Blob
public class Blob extends Object implements Blob, OutputStreamWatcher
The representation (mapping) in the JavaTM programming language of an SQL BLOB value. An SQL BLOB is a built-in type that stores a Binary Large Object as a column value in a row of a database table. The driver implements Blob using an SQL locator(BLOB), which means that a Blob object contains a logical pointer to the SQL BLOB data rather than the data itself. A Blob object is valid for the duration of the transaction in which is was created. Methods in the interfaces ResultSet, CallableStatement, and PreparedStatement, such as getBlob and setBlob allow a programmer to access an SQL BLOB value. The Blob interface provides methods for getting the length of an SQL BLOB (Binary Large Object) value, for materializing a BLOB value on the client, and for determining the position of a pattern of bytes within a BLOB value. This class is new in the JDBC 2.0 API.
-
-
构造器概要
构造器 构造器 说明 Blob(byte[] data, ExceptionInterceptor exceptionInterceptor)Creates a BLOB encapsulating the given binary data
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidfree()InputStreamgetBinaryStream()InputStreamgetBinaryStream(long pos, long length)byte[]getBytes(long pos, int length)longlength()longposition(byte[] pattern, long start)longposition(Blob pattern, long start)OutputStreamsetBinaryStream(long indexToWriteAt)intsetBytes(long writeAt, byte[] bytes)intsetBytes(long writeAt, byte[] bytes, int offset, int length)voidstreamClosed(byte[] byteData)voidstreamClosed(WatchableStream out)Called when the OutputStream being watched has .close() calledvoidtruncate(long len)
-
-
-
构造器详细资料
-
Blob
public Blob(byte[] data, ExceptionInterceptor exceptionInterceptor)Creates a BLOB encapsulating the given binary data- 参数:
data- data to fill the BlobexceptionInterceptor- exception interceptor
-
-
方法详细资料
-
getBinaryStream
public InputStream getBinaryStream() throws SQLException
- 指定者:
getBinaryStream在接口中Blob- 抛出:
SQLException
-
getBytes
public byte[] getBytes(long pos, int length) throws SQLException- 指定者:
getBytes在接口中Blob- 抛出:
SQLException
-
length
public long length() throws SQLException- 指定者:
length在接口中Blob- 抛出:
SQLException
-
position
public long position(byte[] pattern, long start) throws SQLException- 指定者:
position在接口中Blob- 抛出:
SQLException
-
position
public long position(Blob pattern, long start) throws SQLException
- 指定者:
position在接口中Blob- 抛出:
SQLException
-
setBinaryStream
public OutputStream setBinaryStream(long indexToWriteAt) throws SQLException
- 指定者:
setBinaryStream在接口中Blob- 抛出:
SQLException
-
setBytes
public int setBytes(long writeAt, byte[] bytes) throws SQLException- 指定者:
setBytes在接口中Blob- 抛出:
SQLException
-
setBytes
public int setBytes(long writeAt, byte[] bytes, int offset, int length) throws SQLException- 指定者:
setBytes在接口中Blob- 抛出:
SQLException
-
streamClosed
public void streamClosed(byte[] byteData)
-
streamClosed
public void streamClosed(WatchableStream out)
从接口复制的说明:OutputStreamWatcherCalled when the OutputStream being watched has .close() called- 指定者:
streamClosed在接口中OutputStreamWatcher- 参数:
out-WatchableStream
-
truncate
public void truncate(long len) throws SQLException- 指定者:
truncate在接口中Blob- 抛出:
SQLException
-
free
public void free() throws SQLException- 指定者:
free在接口中Blob- 抛出:
SQLException
-
getBinaryStream
public InputStream getBinaryStream(long pos, long length) throws SQLException
- 指定者:
getBinaryStream在接口中Blob- 抛出:
SQLException
-
-