public class ArrayOfByte extends Object
bytes that encodes an "index". Note that
this class does not implement the ConfigurableObject or
TimestampedObject interfaces, and therefore must be special
cased in ObjectHelper methods.ArrayOfBytePrms| Constructor and Description |
|---|
ArrayOfByte() |
| Modifier and Type | Method and Description |
|---|---|
static int |
getIndex(byte[] bytes)
Returns the index encoded in the give
byte array. |
static long |
getTimestamp(byte[] bytes)
Returns the timestamp encoded in the give
byte array, if any. |
static byte[] |
init(int index)
Returns a
byte array that optionally encodes the given
index and a timestamp. |
protected static byte[] |
init(int index,
int size,
boolean encodeKey,
boolean encodeTimestamp)
Returns a
byte array that optionally encodes the given
index and a timestamp. |
static void |
resetTimestamp(byte[] bytes)
Resets the timestamp to the current time.
|
static void |
validate(int index,
byte[] bytes)
Validates that the given
index is encoded in the
given byte array. |
public static byte[] init(int index)
byte array that optionally encodes the given
index and a timestamp.ObjectCreationException - information cannot be encodedprotected static byte[] init(int index,
int size,
boolean encodeKey,
boolean encodeTimestamp)
byte array that optionally encodes the given
index and a timestamp.ObjectCreationException - information cannot be encodedpublic static int getIndex(byte[] bytes)
byte array.ObjectAccessException - The index cannot be decoded from bytespublic static long getTimestamp(byte[] bytes)
byte array, if any.HydraConfigException - The object is not configured to encode a timestamp.ObjectAccessException - The timestamp cannot be decoded from bytespublic static void resetTimestamp(byte[] bytes)
public static void validate(int index,
byte[] bytes)
index is encoded in the
given byte array.ObjectValidationException - If index is not encoded in bytesCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.