public class ArmToken extends ArmInterface implements ArmToken
Modifier and Type | Field and Description |
---|---|
protected static int |
HASHKEY_MAX |
protected int |
m_hashkey |
protected boolean |
m_hashkeyGenerated |
protected byte[] |
m_tokenData |
m_errorCode, m_factory
Constructor and Description |
---|
ArmToken(byte[] dataBytes,
int offset)
Create an ARM Token.
|
ArmToken(byte[] dataBytes,
int offset,
int length)
Create an ARM Token.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
compare(byte[] reference)
compare two ARM Tokens.
|
boolean |
copyBytes(byte[] dest)
Copies the token to a byte array that is already allocated.
|
boolean |
copyBytes(byte[] dest,
int offset)
Copies the token to a byte array that is already allocated.
|
protected byte |
getByte(int offset)
Get a byte at the offset.
|
byte[] |
getBytes()
Returns a newly allocated byte array into which the token is copied.
|
int |
getLength()
Gets the length of the byte array part.
|
int |
hashCode() |
getErrorCode, getErrorMessage, getFactory, setErrorCode, setFactory
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getErrorCode, getErrorMessage, setErrorCode
protected byte[] m_tokenData
protected int m_hashkey
protected boolean m_hashkeyGenerated
protected static final int HASHKEY_MAX
public ArmToken(byte[] dataBytes, int offset)
dataBytes
- offset
- public ArmToken(byte[] dataBytes, int offset, int length)
dataBytes
- offset
- length
- public boolean copyBytes(byte[] dest)
ArmToken
copyBytes
in interface ArmToken
dest
- destination byte array. Its length must be greater
than or equal to the length of the token's byte array.true
if the operation was successful,
false
otherwise. If false
, the contents of
the target array are undetermined. The most likely errors are an
attempt to copy into a null pointer or into an array that is not
long enough to hold the entire token.public boolean copyBytes(byte[] dest, int offset)
ArmToken
copyBytes
in interface ArmToken
dest
- destination byte array. (dest.length-offset)
must be greater than or equal to the length of the token's byte array.offset
- offset in dest
to copying at.true
if the operation was successful,
false
otherwise. If false
, the contents of
the target array are undetermined. The most likely errors are an
attempt to copy into a null pointer or into an array that is not
long enough to hold the entire token.public byte[] getBytes()
ArmToken
getLength()
and then executing copyBytes()
into the new array. The ARM implementation would typically not keep
a reference to the array, because that would interfere with garbage
collection.public int getLength()
ArmToken
public int hashCode()
hashCode
in class java.lang.Object
protected boolean compare(byte[] reference)
reference
- protected byte getByte(int offset)
offset
-