Class ByteLongObject

  • All Implemented Interfaces:
    BlobAccessor, java.io.Serializable

    public class ByteLongObject
    extends java.lang.Object
    implements java.io.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:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ByteLongObject​(byte[] from)  
      ByteLongObject​(byte[] from, int offset, int length)
      Constructor.
      ByteLongObject​(java.io.InputStream in, int length)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte getByte​(int n)
      Returns the byte at offset 'n' into the binary object.
      byte[] getByteArray()
      Returns the internal byte[] of this binary object.
      java.io.InputStream getInputStream()
      Returns an InputStream that allows us to read the entire byte long object.
      int length()
      Returns the size of the data in this object.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ByteLongObject

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

        public ByteLongObject​(byte[] from)
      • ByteLongObject

        public ByteLongObject​(java.io.InputStream in,
                              int length)
                       throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • 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 java.io.InputStream getInputStream()
        Returns an InputStream that allows us to read the entire byte long object.
        Specified by:
        getInputStream in interface BlobAccessor
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object