Package com.mckoi.database.global
Class StreamableObject
- java.lang.Object
-
- com.mckoi.database.global.StreamableObject
-
public final class StreamableObject extends java.lang.Object
An object that is streamable (such as a long binary object, or a long string object). This is passed between client and server and contains basic primitive information about the object it represents. The actual contents of the object itself must be obtained through other means (see com.mckoi.database.jdbc.DatabaseInterface).- Author:
- Tobias Downer
-
-
Constructor Summary
Constructors Constructor Description StreamableObject(byte type, long size, long id)
Constructs the StreamableObject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getIdentifier()
Returns an identifier that can identify this object within some context.long
getSize()
Returns the size of the object stream, or -1 if the size is unknown.byte
getType()
Returns the type of object this stub represents.
-
-
-
Method Detail
-
getType
public byte getType()
Returns the type of object this stub represents. Returns 1 if it represents 2-byte unicde character object, 2 if it represents binary data.
-
getSize
public long getSize()
Returns the size of the object stream, or -1 if the size is unknown. If this represents a unicode character string, you would calculate the total characters as size / 2.
-
getIdentifier
public long getIdentifier()
Returns an identifier that can identify this object within some context. For example, if this is a streamable object on the client side, then the identifier might be the value that is able to retreive a section of the streamable object from the DatabaseInterface.
-
-