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 void
free()
java.io.InputStream
getBinaryStream()
java.io.InputStream
getBinaryStream(long pos, long length)
byte[]
getBytes(long pos, int length)
long
length()
long
position(byte[] pattern, long start)
long
position(java.sql.Blob 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)
-
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:
length
in interfacejava.sql.Blob
- Throws:
java.sql.SQLException
-
getBytes
public byte[] getBytes(long pos, int length) throws java.sql.SQLException
- Specified by:
getBytes
in interfacejava.sql.Blob
- Throws:
java.sql.SQLException
-
getBinaryStream
public java.io.InputStream getBinaryStream() throws java.sql.SQLException
- Specified by:
getBinaryStream
in interfacejava.sql.Blob
- Throws:
java.sql.SQLException
-
position
public long position(byte[] pattern, long start) throws java.sql.SQLException
- Specified by:
position
in interfacejava.sql.Blob
- Throws:
java.sql.SQLException
-
position
public long position(java.sql.Blob pattern, long start) throws java.sql.SQLException
- Specified by:
position
in interfacejava.sql.Blob
- Throws:
java.sql.SQLException
-
setBytes
public int setBytes(long pos, byte[] bytes) throws java.sql.SQLException
- Specified by:
setBytes
in 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:
setBytes
in interfacejava.sql.Blob
- Throws:
java.sql.SQLException
-
setBinaryStream
public java.io.OutputStream setBinaryStream(long pos) throws java.sql.SQLException
- Specified by:
setBinaryStream
in interfacejava.sql.Blob
- Throws:
java.sql.SQLException
-
truncate
public void truncate(long len) throws java.sql.SQLException
- Specified by:
truncate
in interfacejava.sql.Blob
- Throws:
java.sql.SQLException
-
free
public void free() throws java.sql.SQLException
- Specified by:
free
in interfacejava.sql.Blob
- Throws:
java.sql.SQLException
-
getBinaryStream
public java.io.InputStream getBinaryStream(long pos, long length) throws java.sql.SQLException
- Specified by:
getBinaryStream
in interfacejava.sql.Blob
- Throws:
java.sql.SQLException
-
-