Servertec
Persistent Object Store
1.4.1 09/04/2005

stec.pos
Class Blob

java.lang.Object
  extended by stec.pos.Blob
All Implemented Interfaces:
java.io.Serializable

public class Blob
extends java.lang.Object
implements java.io.Serializable

A more efficient way to store byte arrays in persistent object stores and indexes.

Since:
1.0.0 08/12/2001
See Also:
Serialized Form

Constructor Summary
Blob(byte[] bytes)
          Constructs a new Blob from the specified byte array.
 
Method Summary
 int compareTo(Blob blob)
          Returns whether the current Blob equals the specified Blob or which Blob is greater than and which Blob is less than.
 int compareTo(java.lang.Object object)
          Returns whether the current Blob equals the specified Blob or which Blob is greater than and which Blob is less than.
 boolean equals(Blob blob)
          Returns whether the current Blob equals the specified Blob.
 boolean equals(java.lang.Object object)
          Returns whether the current Blob equals the specified object.
 byte getByteAt(int index)
          Returns the byte at the specified index.
 byte[] getValue()
          Returns the value of the Blob.
 int length()
          Returns the number of bytes in the Blob.
 void setByteAt(int index, byte b)
          Sets the byte at the specified index to the given byte.
 void setValue(byte[] bytes)
          Changes the value of the Blob.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Blob

public Blob(byte[] bytes)
     throws java.lang.NullPointerException
Constructs a new Blob from the specified byte array.

Parameters:
bytes - the byte array.
Throws:
java.lang.NullPointerException - if the parameter passed is null.
Method Detail

getValue

public byte[] getValue()
Returns the value of the Blob.

Returns:
the byte array.

setValue

public void setValue(byte[] bytes)
Changes the value of the Blob.

Parameters:
bytes - the byte array.
Throws:
java.lang.NullPointerException - if the parameter passed is null.

length

public int length()
Returns the number of bytes in the Blob.

Returns:
the number of bytes in the Blob.

getByteAt

public byte getByteAt(int index)
               throws java.lang.IndexOutOfBoundsException
Returns the byte at the specified index.

Parameters:
index - the index of the byte.
Returns:
the byte at the specified index.
Throws:
java.lang.IndexOutOfBoundsException - if index is negative or greater than or equal to length().

setByteAt

public void setByteAt(int index,
                      byte b)
               throws java.lang.IndexOutOfBoundsException
Sets the byte at the specified index to the given byte.

Parameters:
index - the index of the byte.
b - the byte.
Throws:
java.lang.IndexOutOfBoundsException - if index is negative or greater than or equal to length().

equals

public boolean equals(java.lang.Object object)
               throws java.lang.ClassCastException
Returns whether the current Blob equals the specified object.

Overrides:
equals in class java.lang.Object
Parameters:
object - the object to check.
Returns:
whether the current Blob equals the specified object.
Throws:
java.lang.ClassCastException - if the object specified is not a Blob.

equals

public boolean equals(Blob blob)
Returns whether the current Blob equals the specified Blob.

Parameters:
blob - the Blob to check.
Returns:
whether the current Blob equals the specified Blob.

compareTo

public int compareTo(java.lang.Object object)
              throws java.lang.ClassCastException
Returns whether the current Blob equals the specified Blob or which Blob is greater than and which Blob is less than.

Parameters:
object - the Blob to compare.
Returns:
the value 0 if the current Blob is equal to the specified Blob; a value less than 0 if the current Blob is less than the specified Blob; and a value greater than 0 if the current Blob is greater than the specified Blob.
Throws:
java.lang.ClassCastException - if the object specified is not a Blob.

compareTo

public int compareTo(Blob blob)
Returns whether the current Blob equals the specified Blob or which Blob is greater than and which Blob is less than.

Parameters:
blob - the Blob to compare.
Returns:
the value 0 if the current Blob is equal to the specified Blob; a value less than 0 if the current Blob is less than the specified Blob; and a value greater than 0 if the current Blob is greater than the specified Blob.

Servertec
Persistent Object Store
1.4.1 09/04/2005

Copyright © 2001-2005 Servertec. All rights reserved.