com.mckoi.database.global
Class StreamableObject

java.lang.Object
  extended by 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
StreamableObject(byte type, long size, long id)
          Constructs the StreamableObject.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamableObject

public StreamableObject(byte type,
                        long size,
                        long id)
Constructs the StreamableObject.

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.