Package com.mckoi.database.jdbc
Class MStreamableBlob
- java.lang.Object
-
- com.mckoi.database.jdbc.AbstractStreamableObject
-
- com.mckoi.database.jdbc.MStreamableBlob
-
- All Implemented Interfaces:
java.sql.Blob
class MStreamableBlob extends AbstractStreamableObject implements java.sql.Blob
A Blob that is a large object that may be streamed from the server directly to this object. A blob that is streamable is only alive for the lifetime of the result set it is part of. If the underlying result set that contains this streamable blob is closed then this blob is no longer valid.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.mckoi.database.jdbc.AbstractStreamableObject
AbstractStreamableObject.StreamableObjectInputStream
-
-
Field Summary
-
Fields inherited from class com.mckoi.database.jdbc.AbstractStreamableObject
connection, result_set_id
-
-
Constructor Summary
Constructors Constructor Description MStreamableBlob(MConnection connection, int result_set_id, byte type, long streamable_object_id, long size)Constructs the blob.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfree()java.io.InputStreamgetBinaryStream()java.io.InputStreamgetBinaryStream(long pos, long length)byte[]getBytes(long pos, int length)longlength()longposition(byte[] pattern, long start)longposition(java.sql.Blob pattern, long start)java.io.OutputStreamsetBinaryStream(long pos)intsetBytes(long pos, byte[] bytes)intsetBytes(long pos, byte[] bytes, int offset, int len)voidtruncate(long len)-
Methods inherited from class com.mckoi.database.jdbc.AbstractStreamableObject
getStreamableId, getType, rawSize
-
-
-
-
Constructor Detail
-
MStreamableBlob
MStreamableBlob(MConnection connection, int result_set_id, byte type, long streamable_object_id, long size)
Constructs the blob.
-
-
Method Detail
-
length
public long length() throws java.sql.SQLException- Specified by:
lengthin interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
getBytes
public byte[] getBytes(long pos, int length) throws java.sql.SQLException- Specified by:
getBytesin interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
getBinaryStream
public java.io.InputStream getBinaryStream() throws java.sql.SQLException- Specified by:
getBinaryStreamin interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
position
public long position(byte[] pattern, long start) throws java.sql.SQLException- Specified by:
positionin interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
position
public long position(java.sql.Blob pattern, long start) throws java.sql.SQLException- Specified by:
positionin interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
setBytes
public int setBytes(long pos, byte[] bytes) throws java.sql.SQLException- Specified by:
setBytesin interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
setBytes
public int setBytes(long pos, byte[] bytes, int offset, int len) throws java.sql.SQLException- Specified by:
setBytesin interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
setBinaryStream
public java.io.OutputStream setBinaryStream(long pos) throws java.sql.SQLException- Specified by:
setBinaryStreamin interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
truncate
public void truncate(long len) throws java.sql.SQLException- Specified by:
truncatein interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
free
public void free() throws java.sql.SQLException- Specified by:
freein interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
getBinaryStream
public java.io.InputStream getBinaryStream(long pos, long length) throws java.sql.SQLException- Specified by:
getBinaryStreamin interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
-