representation of a short (16-bit) field at a fixed location within
a byte array
| Constructor: |
public ShortField(int offset) throws ArrayIndexOutOfBoundsException {
if (offset < 0)
{
throw new ArrayIndexOutOfBoundsException("Illegal offset: "
+ offset);
}
_offset = offset;
}
construct the ShortField with its offset into its containing
byte array Parameters:
offset - of the field within its byte array
Throws:
ArrayIndexOutOfBoundsException - if offset is negative
- exception:
ArrayIndexOutOfBoundsException - if offset is negative
|
public ShortField(int offset,
short value) throws ArrayIndexOutOfBoundsException {
this(offset);
set(value);
}
construct the ShortField with its offset into its containing
byte array and initialize its value Parameters:
offset - of the field within its byte array
value - the initial value
Throws:
ArrayIndexOutOfBoundsException - if offset is negative
- exception:
ArrayIndexOutOfBoundsException - if offset is negative
|
public ShortField(int offset,
byte[] data) throws ArrayIndexOutOfBoundsException {
this(offset);
readFromBytes(data);
}
Construct the ShortField with its offset into its containing
byte array and initialize its value from its byte array Parameters:
offset - of the field within its byte array
data - the byte array to read the value from
Throws:
ArrayIndexOutOfBoundsException - if the offset is not
within the range of 0..(data.length - 1)
- exception:
ArrayIndexOutOfBoundsException - if the offset is not
within the range of 0..(data.length - 1)
|
public ShortField(int offset,
short value,
byte[] data) throws ArrayIndexOutOfBoundsException {
this(offset);
set(value, data);
}
construct the ShortField with its offset into its containing
byte array, initialize its value, and write its value to its
byte array Parameters:
offset - of the field within its byte array
value - the initial value
data - the byte array to write the value to
Throws:
ArrayIndexOutOfBoundsException - if offset is negative
- exception:
ArrayIndexOutOfBoundsException - if offset is negative
|