Package com.mckoi.database.jdbc
Class AbstractStreamableObject
- java.lang.Object
-
- com.mckoi.database.jdbc.AbstractStreamableObject
-
- Direct Known Subclasses:
MStreamableBlob
,MStreamableClob
abstract class AbstractStreamableObject extends java.lang.Object
An abstract class that provides various convenience behaviour for creating streamable java.sql.Blob and java.sql.Clob classes. A streamable object is typically a large object that can be fetched in separate pieces from the server. A streamable object only survives for as long as the ResultSet that it is part of is open.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
AbstractStreamableObject.StreamableObjectInputStream
An InputStream that is used to read the data from the streamable object as a basic byte encoding.
-
Field Summary
Fields Modifier and Type Field Description protected MConnection
connection
The MConnection object that this object was returned as part of the result of.protected int
result_set_id
The result_id of the ResultSet this clob is from.private long
size
The size of the streamable object.private long
streamable_object_id
The streamable object identifier.private byte
type
The type of encoding of the stream.
-
Constructor Summary
Constructors Constructor Description AbstractStreamableObject(MConnection connection, int result_set_id, byte type, long streamable_object_id, long size)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected long
getStreamableId()
Returns the streamable object identifier for referencing this streamable object on the server.protected byte
getType()
Returns the encoding type of this object.protected long
rawSize()
Returns the number of bytes in this streamable object.
-
-
-
Field Detail
-
connection
protected final MConnection connection
The MConnection object that this object was returned as part of the result of.
-
result_set_id
protected final int result_set_id
The result_id of the ResultSet this clob is from.
-
streamable_object_id
private final long streamable_object_id
The streamable object identifier.
-
type
private final byte type
The type of encoding of the stream.
-
size
private final long size
The size of the streamable object.
-
-
Constructor Detail
-
AbstractStreamableObject
AbstractStreamableObject(MConnection connection, int result_set_id, byte type, long streamable_object_id, long size)
Constructor.
-
-
Method Detail
-
getStreamableId
protected long getStreamableId()
Returns the streamable object identifier for referencing this streamable object on the server.
-
getType
protected byte getType()
Returns the encoding type of this object.
-
rawSize
protected long rawSize()
Returns the number of bytes in this streamable object. Note that this may not represent the actual size of the object when it is decoded. For example, a Clob may be encoded as 2-byte per character (unicode) so the actual length of the clob with be size / 2.
-
-