Class StreamableObject

java.lang.Object
com.mckoi.database.global.StreamableObject

public final class StreamableObject extends 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

    Modifier and Type
    Method
    Description
    long
    Returns an identifier that can identify this object within some context.
    long
    Returns the size of the object stream, or -1 if the size is unknown.
    byte
    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 Details

    • StreamableObject

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

    • 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.