|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
Object
ByteArray
public class ByteArray
This class implements an facade for byte[].
Size of array is fixed and cannot be changed after it is created.
The single bytes (elements) in this array can be accessed with the operators
get and
set using brackets.
| Constructor Summary | |
|---|---|
ByteArray(int length)
Creates a new byte[] with specified length. |
|
| Method Summary | |
|---|---|
ByteArray |
clear(int fill)
Fills the whole array with specified byte. |
boolean |
getBit(int bit)
Returns the bit at specified index. |
int |
length()
Returns the length of this array. |
int |
operator_get(int index)
Returns the byte at specified index. |
int |
operator_set(int index,
int value)
Sets the byte at specified index. |
ByteArray |
set$(int offset)
Sets multiple bytes at once, starting from specified offset. |
ByteArray |
setBit(int bit,
boolean enabled)
Sets the bit at specified index. |
ByteArray |
setLength(int length)
Creates a new array with specified length. |
ByteArray |
sha1()
Computes digest from this array using SHA1 algorithm. |
| Methods inherited from class Object |
|---|
toString, equals, hashCode |
| Methods inherited from |
|---|
equals, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ByteArray(int length)
byte[] with specified length.
length - Length of array, must be >= 0| Method Detail |
|---|
public int operator_get(int index)
index - Index to array
public int operator_set(int index,
int value)
index - Index to arrayvalue - New value for index
public ByteArray setLength(int length)
length - New length of array
public int length()
public ByteArray setBit(int bit,
boolean enabled)
bit - Index of bit to check.enabled - Bit on/off
getBit(int)public boolean getBit(int bit)
bit - Index of bit to check.
setBit(int, boolean)public ByteArray clear(int fill)
fill - Filler byte
public ByteArray set$(int offset)
ByteArray hello = new ByteArray(5).set(0, 'H', 'e', 'l', 'l', 'o');
offset - Offset to start setting from
public ByteArray sha1()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||