|
Servertec Persistent Object Store 1.4.1 09/04/2005 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstec.pos.ByteArray
public final class ByteArray
Static methods for manipulating byte arrays used by when storing and retrieving key, value pairs from peristent object stores and indexes.
Field Summary | |
---|---|
static byte |
BIGDECIMAL
Specifies a BigDecimal. |
static byte |
BIGINTEGER
Specifies a BigInteger. |
static byte |
BLOB
Specifies a Blob. |
static byte |
BOOLEAN
Specifies a boolean. |
static byte |
BYTE
Specifies a byte. |
static byte |
BYTE_ARRAY
Specifies an array of bytes. |
static byte |
CHAR
Specifies a char. |
static byte |
DATE
Specifies a Date. |
static byte |
DOUBLE
Specifies a double. |
static byte |
DUPLICATES
Specifies duplicates. |
static byte |
FLOAT
Specifies a float. |
static byte |
INT
Specifies an int. |
static byte |
LONG
Specifies a long. |
static byte |
NULL
Specifies a null. |
static byte |
OBJECT
Specifies an Object. |
static byte |
SHORT
Specifies a short. |
static byte |
STRING
Specifies a String. |
Constructor Summary | |
---|---|
ByteArray()
|
Method Summary | |
---|---|
static java.lang.Object |
decodeObject(byte[] bytes,
int offset)
Returns the Object encoded at the specified offset in the given byte array. |
static void |
encodeObject(byte[] bytes,
int offset,
java.lang.Object object)
Encodes the given Object at the specified offset in the given byte array. |
static java.math.BigDecimal |
getBigDecimal(byte[] bytes,
int offset)
Returns the java.math.BigDecimal at the specified offset in the given byte array. |
static java.math.BigInteger |
getBigInteger(byte[] bytes,
int offset)
Returns the java.math.BigInteger at the specified offset in the given byte array. |
static Blob |
getBlob(byte[] bytes,
int offset)
Returns the Blob at the specified offset in the given byte array. |
static boolean |
getBoolean(byte[] bytes,
int offset)
Returns the boolean at the specified offset in the given byte array. |
static byte |
getByte(byte[] bytes,
int offset)
Returns the byte at the specified offset in the given byte array. |
static byte[] |
getByteArray(byte[] bytes,
int offset)
Returns the byte array at the specified offset in the given byte array. |
static char |
getChar(byte[] bytes,
int offset)
Returns the char at the specified offset in the given byte array. |
static java.util.Date |
getDate(byte[] bytes,
int offset)
Returns the Date at the specified offset in the given byte array. |
static double |
getDouble(byte[] bytes,
int offset)
Returns the double at the specified offset in the given byte array. |
static int |
getEncodedObjectLength(java.lang.Object object)
Returns the number of bytes needed by the specifed Object when converted into an encoded byte array. |
static int |
getEncodedType(java.lang.Object object)
Returns the encoded type. |
static float |
getFloat(byte[] bytes,
int offset)
Returns the float at the specified offset in the given byte array. |
static int |
getInt(byte[] bytes,
int offset)
Returns the int at the specified offset in the given byte array. |
static long |
getLong(byte[] bytes,
int offset)
Returns the long at the specified offset in the given byte array. |
static java.lang.Object |
getObject(byte[] bytes,
int offset)
Returns the Object at the specified offset in the given byte array. |
static int |
getObjectLength(java.lang.Object object)
Returns the number of bytes needed by the specifed Object when converted into a byte array. |
static short |
getShort(byte[] bytes,
int offset)
Returns the short at the specified offset in the given byte array. |
static java.lang.String |
getString(byte[] bytes,
int offset)
Returns the String at the specified offset in the given byte array. |
static int |
getStringLength(java.lang.String string)
Returns the number of bytes needed by the specifed String when converted into an encoded byte array. |
static java.lang.String |
getUtf8String(byte[] bytes,
int offset)
Returns the UTF-8 encoded String at the specified offset in the given byte array. |
static int |
getUtf8StringLength(java.lang.String string)
Returns the number of bytes needed by the specifed String when converted into a UTF-8 encoded byte array. |
static void |
setBigDecimal(byte[] bytes,
int offset,
java.math.BigDecimal decimal)
Sets the java.math.BigDecimal at the specified offset in the given byte array to the specified decimal. |
static void |
setBigInteger(byte[] bytes,
int offset,
java.math.BigInteger integer)
Sets the java.math.BigInteger at the specified offset in the given byte array to the specified integer. |
static void |
setBlob(byte[] bytes,
int offset,
Blob blob)
Sets the Blob at the specified offset in the given byte array to the specified Blob. |
static void |
setBoolean(byte[] bytes,
int offset,
boolean b)
Sets the boolean at the specified offset in the given byte array to the specified boolean. |
static void |
setByte(byte[] bytes,
int offset,
int b)
Sets the byte at the specified offset in the given byte array to the specified byte. |
static void |
setByteArray(byte[] bytes,
int offset,
byte[] byte_array)
Sets the byte array at the specified offset in the given byte array to the specified byte array. |
static void |
setChar(byte[] bytes,
int offset,
int c)
Sets the char at the specified offset in the given byte array to the specified char. |
static void |
setDate(byte[] bytes,
int offset,
java.util.Date date)
Sets the Date at the specified offset in the given byte array to the specified Date. |
static void |
setDouble(byte[] bytes,
int offset,
double d)
Sets the double at the specified offset in the given byte array to the specified double. |
static void |
setFloat(byte[] bytes,
int offset,
float f)
Sets the float at the specified offset in the given byte array to the specified float. |
static void |
setInt(byte[] bytes,
int offset,
int i)
Sets the int at the specified offset in the given byte array to the specified int. |
static void |
setLong(byte[] bytes,
int offset,
long l)
Sets the long at the specified offset in the given byte array to the specified long. |
static void |
setObject(byte[] bytes,
int offset,
java.lang.Object object)
Sets the Object at the specified offset in the given byte array to the specified Object. |
static void |
setShort(byte[] bytes,
int offset,
int s)
Sets the short at the specified offset in the given byte array to the specified short. |
static void |
setString(byte[] bytes,
int offset,
java.lang.String string)
Sets the String at the specified offset in the given byte array to the specified String. |
static void |
setUtf8String(byte[] bytes,
int offset,
java.lang.String string)
Sets the UTF-8 encoded String at the specified offset in the given byte array to the specified String. |
static byte[] |
toByteArray(java.lang.Object object)
Returns a byte array containing the specified Object. |
static byte[] |
toEncodedByteArray(java.lang.Object object)
Returns a byte array containing the specified Object encoded. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte NULL
Used when encoding Objects and decoding Objects.
encodeObject
,
decodeObject
,
toByteArray
,
Constant Field Valuespublic static final byte BYTE
Used when encoding Objects and decoding Objects.
encodeObject
,
decodeObject
,
toByteArray
,
Constant Field Valuespublic static final byte CHAR
Used when encoding Objects and decoding Objects.
encodeObject
,
decodeObject
,
toByteArray
,
Constant Field Valuespublic static final byte SHORT
Used when encoding Objects and decoding Objects.
encodeObject
,
decodeObject
,
toByteArray
,
Constant Field Valuespublic static final byte INT
Used when encoding Objects and decoding Objects.
encodeObject
,
decodeObject
,
toByteArray
,
Constant Field Valuespublic static final byte LONG
Used when encoding Objects and decoding Objects.
encodeObject
,
decodeObject
,
toByteArray
,
Constant Field Valuespublic static final byte FLOAT
Used when encoding Objects and decoding Objects.
encodeObject
,
decodeObject
,
toByteArray
,
Constant Field Valuespublic static final byte DOUBLE
Used when encoding Objects and decoding Objects.
encodeObject
,
decodeObject
,
toByteArray
,
Constant Field Valuespublic static final byte STRING
Used when encoding Objects and decoding Objects.
encodeObject
,
decodeObject
,
toByteArray
,
Constant Field Valuespublic static final byte OBJECT
Used when encoding Objects and decoding Objects.
encodeObject
,
decodeObject
,
toByteArray
,
Constant Field Valuespublic static final byte BOOLEAN
Used when encoding Objects and decoding Objects.
encodeObject
,
decodeObject
,
toByteArray
,
Constant Field Valuespublic static final byte BLOB
Used when encoding Objects and decoding Objects.
encodeObject
,
decodeObject
,
toByteArray
,
Constant Field Valuespublic static final byte DATE
Used when encoding Objects and decoding Objects.
encodeObject
,
decodeObject
,
toByteArray
,
Constant Field Valuespublic static final byte BIGINTEGER
Used when encoding Objects and decoding Objects.
encodeObject
,
decodeObject
,
toByteArray
,
Constant Field Valuespublic static final byte BIGDECIMAL
Used when encoding Objects and decoding Objects.
encodeObject
,
decodeObject
,
toByteArray
,
Constant Field Valuespublic static final byte BYTE_ARRAY
Used when encoding Objects and decoding Objects.
encodeObject
,
decodeObject
,
toByteArray
,
Constant Field Valuespublic static final byte DUPLICATES
Used to specify the data type for values when the index being used supports duplicates. Used by indexes when support for duplicates is specified.
Constructor Detail |
---|
public ByteArray()
Method Detail |
---|
public static final byte getByte(byte[] bytes, int offset)
bytes
- the byte array.offset
- the offset.
public static final void setByte(byte[] bytes, int offset, int b)
bytes
- the byte array.offset
- the offset.b
- the byte to use.public static final char getChar(byte[] bytes, int offset)
bytes
- the byte array.offset
- the offset.
public static final void setChar(byte[] bytes, int offset, int c)
bytes
- the byte array.offset
- the offset.c
- the character to use.public static final short getShort(byte[] bytes, int offset)
bytes
- the byte array.offset
- the offset.
public static final void setShort(byte[] bytes, int offset, int s)
bytes
- the byte array.offset
- the offset.s
- the short to use.public static final int getInt(byte[] bytes, int offset)
bytes
- the byte array.offset
- the offset.
public static final void setInt(byte[] bytes, int offset, int i)
bytes
- the byte array.offset
- the offset.i
- the integer to use.public static final long getLong(byte[] bytes, int offset)
bytes
- the byte array.offset
- the offset.
public static final void setLong(byte[] bytes, int offset, long l)
bytes
- the byte array.offset
- the offset.l
- the long to use.public static final float getFloat(byte[] bytes, int offset)
bytes
- the byte array.offset
- the offset.
public static final void setFloat(byte[] bytes, int offset, float f)
bytes
- the byte array.offset
- the offset.f
- the float to use.public static final double getDouble(byte[] bytes, int offset)
bytes
- the byte array.offset
- the offset.
public static final void setDouble(byte[] bytes, int offset, double d)
bytes
- the byte array.offset
- the offset.d
- the double to use.public static final boolean getBoolean(byte[] bytes, int offset)
bytes
- the byte array.offset
- the offset.
public static final void setBoolean(byte[] bytes, int offset, boolean b)
bytes
- the byte array.offset
- the offset.b
- the boolean to use.public static final java.lang.String getString(byte[] bytes, int offset) throws java.io.UTFDataFormatException
Encoding: utf_8_string_value
bytes
- the byte array.offset
- the offset.
java.io.UTFDataFormatException
- if the String is not UTF-8 encoded.public static final void setString(byte[] bytes, int offset, java.lang.String string)
Encoding: utf_8_string_value
bytes
- the byte array.offset
- the offset.string
- the String to use.public static final java.lang.String getUtf8String(byte[] bytes, int offset) throws java.io.UTFDataFormatException
Encoding: 4_byte_utf_8_string_length utf_8_string_value
bytes
- the byte array.offset
- the offset.
java.io.UTFDataFormatException
- if the String is not UTF-8 encoded.public static final void setUtf8String(byte[] bytes, int offset, java.lang.String string)
Encoding: 4_byte_utf_8_string_length utf_8_string_value
bytes
- the byte array.offset
- the offset.string
- the String to use.public static final java.lang.Object getObject(byte[] bytes, int offset) throws java.lang.ClassNotFoundException, java.io.OptionalDataException, java.io.IOException
bytes
- the byte array.offset
- the offset.
java.lang.ClasSNotFoundException
- if the named class is not defined.
java.io.OptionalDataException
- if the class encoding is invalid.
java.io.IOException
- if an I/O exception occurred.
java.lang.ClassNotFoundException
public static final void setObject(byte[] bytes, int offset, java.lang.Object object) throws java.io.IOException
bytes
- the byte array.offset
- the offset.object
- the Object to use.
java.io.IOException
- if an I/O exception occurred.public static final Blob getBlob(byte[] bytes, int offset)
bytes
- the byte array.offset
- the offset.
public static final void setBlob(byte[] bytes, int offset, Blob blob)
bytes
- the byte array.offset
- the offset.blob
- the Blob to use.public static final java.util.Date getDate(byte[] bytes, int offset)
bytes
- the byte array.offset
- the offset.
public static final void setDate(byte[] bytes, int offset, java.util.Date date)
bytes
- the byte array.offset
- the offset.date
- the Date to use.public static final java.math.BigInteger getBigInteger(byte[] bytes, int offset)
bytes
- the byte array.offset
- the offset.
public static final void setBigInteger(byte[] bytes, int offset, java.math.BigInteger integer)
bytes
- the byte array.offset
- the offset.integer
- the BigInteger to use.public static final java.math.BigDecimal getBigDecimal(byte[] bytes, int offset)
bytes
- the byte array.offset
- the offset.
public static final void setBigDecimal(byte[] bytes, int offset, java.math.BigDecimal decimal)
bytes
- the byte array.offset
- the offset.decimal
- the BigDecimal to use.public static final byte[] getByteArray(byte[] bytes, int offset)
bytes
- the byte array.offset
- the offset.
public static final void setByteArray(byte[] bytes, int offset, byte[] byte_array)
bytes
- the byte array.offset
- the offset.byte_array
- the array of bytes to use.public static final java.lang.Object decodeObject(byte[] bytes, int offset) throws java.lang.ClassNotFoundException, java.io.OptionalDataException, java.io.UTFDataFormatException, java.io.IOException
Encoding: 1_byte_type encoded_object
bytes
- the byte array.offset
- the byte array.
java.lang.ClasSNotFoundException
- if the named class is not defined.
java.io.OptionalDataException
- if the class encoding is invalid.
java.io.UTFDataFormatException
- if the String is not UTF-8 encoded.
java.io.IOException
- if an I/O exception occurred.
java.lang.ClassNotFoundException
public static final void encodeObject(byte[] bytes, int offset, java.lang.Object object) throws java.io.IOException
Encoding: 1_byte_type encoded_object
bytes
- the byte array.offset
- the offset.object
- the Object to use.
java.io.IOException
- if an I/O exception occurred.public static final byte[] toByteArray(java.lang.Object object) throws java.io.IOException
object
- the Object to use.
java.io.IOException
- if an I/O exception occurred.public static final byte[] toEncodedByteArray(java.lang.Object object) throws java.io.IOException
Encoding: 1_byte_type encoded_object
object
- the Object to use.
java.io.IOException
- if an I/O exception occurred.public static final int getEncodedType(java.lang.Object object)
object
- the Object to use.
public static final int getStringLength(java.lang.String string)
string
- the specified String.
public static final int getUtf8StringLength(java.lang.String string)
same as getStringLength() + 4
Encoding: 4_byte_utf_8_string_length utf_8_string_value
string
- the specified String.
public static final int getObjectLength(java.lang.Object object) throws java.io.IOException
object
- the specified Object.
java.io.IOException
- if an I/O exception occurred.public static final int getEncodedObjectLength(java.lang.Object object) throws java.io.IOException
same as getObjectLength() + 1
Encoding: 1_byte_type encoded_object
object
- the specified Object.
java.io.IOException
- if an I/O exception occurred.
|
Servertec Persistent Object Store 1.4.1 09/04/2005 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2001-2005 Servertec. All rights reserved.