Class ByteLongObject

java.lang.Object
com.mckoi.database.global.ByteLongObject
All Implemented Interfaces:
BlobAccessor, Serializable

public class ByteLongObject extends Object implements Serializable, BlobAccessor
A byte array that can be transferred between the client and server. This is used for transferring BLOB data to/from the database engine.
Author:
Tobias Downer
See Also:
  • Constructor Details

    • ByteLongObject

      public ByteLongObject(byte[] from, int offset, int length)
      Constructor.
    • ByteLongObject

      public ByteLongObject(byte[] from)
    • ByteLongObject

      public ByteLongObject(InputStream in, int length) throws IOException
      Throws:
      IOException
  • Method Details

    • length

      public int length()
      Returns the size of the data in this object.
      Specified by:
      length in interface BlobAccessor
    • getByte

      public byte getByte(int n)
      Returns the byte at offset 'n' into the binary object.
    • getByteArray

      public byte[] getByteArray()
      Returns the internal byte[] of this binary object. Care needs to be taken when handling this object because altering the contents will change this object.
    • getInputStream

      public InputStream getInputStream()
      Returns an InputStream that allows us to read the entire byte long object.
      Specified by:
      getInputStream in interface BlobAccessor
    • toString

      public String toString()
      Overrides:
      toString in class Object