com.ibm.ws.security.util
Class ByteArray
- java.lang.Object
com.ibm.ws.security.util.ByteArray
All implemented interfaces:
java.io.Serializable
- public class ByteArray
- extends java.lang.Object
- implements java.io.Serializable
This module is a utility class to work with byte arrays. It performs initialization, copies and compares byte arrays.
Since:
1.0
Version:
1.0
See Also:
Constructor Summary
Constructor and Description |
---|
ByteArray(byte[] barray)
Default constructor
Returns a ByteArray given a byte[]
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
compare(byte[] a,byte[] b)
The
compare method compares the byte arrays for equality.
|
|
copy(byte[] from,int offsetFrom,int len,byte[] to,int offsetTo)
The
copy method copies data of length len
from the array from to the array to ,
from the offset offsetFrom to the offset offsetTo .
|
|
equals(java.lang.Object arrayObj)
The
equals method determines if the
array object passed in is equal to another array.
|
|
getArray()
The
getArray method returns a byte array
of type byte [].
|
|
hashCode()
The
hashCode method determines the hash of an array.
|
|
initialize(byte[] array,byte val)
The
initialize method initializes the array to a given value.
|
|
setArray(byte[] array)
The
setArray method sets the byte array
of type byte[].
|
|
XOR(byte[] a,byte b)
The
XOR method performs the xor function of two byte arrays.
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail
ByteArray
- public ByteArray(byte[] barray)
Method Detail
getArray
- public byte[] getArray()
The getArray
method returns a byte array
of type byte [].
Returns:
the byte[]
setArray
- public void setArray(byte[] array)
The setArray
method sets the byte array
of type byte[].
equals
- public boolean equals(java.lang.Object arrayObj)
The equals
method determines if the
array object passed in is equal to another array.
Overrides:
equals
in class java.lang.Object
Returns:
true if the two arrays are equal
hashCode
- public int hashCode()
The hashCode
method determines the hash of an array.
Overrides:
hashCode
in class java.lang.Object
Returns:
the hash
initialize
- public static void initialize(byte[] array,
- byte val)
The initialize
method initializes the array to a given value.
copy
- public static void copy(byte[] from,
- int offsetFrom,
- int len,
- byte[] to,
- int offsetTo)
The copy
method copies data of length len
from the array from
to the array to
,
from the offset offsetFrom
to the offset offsetTo
.
compare
- public static boolean compare(byte[] a,
- byte[] b)
The
compare
method compares the byte arrays for equality.
Returns:
true if the byte arrays are equal
XOR
- public static byte[] XOR(byte[] a,
- byte b)
The
XOR
method performs the xor function of two byte arrays.
Returns:
the resulting byte array
Default constructor
Returns a ByteArray given a byte[]