com.ibm.jzos.fields
Class ByteArrayField
- java.lang.Object
-
- com.ibm.jzos.fields.ByteArrayField
-
-
Constructor Summary
Constructors Constructor and Description ByteArrayField(int offset, int length)Construct an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(byte[] ba1, byte[] ba2)Compare two byte arrays, possible null, for equality.byte[]getByteArray(byte[] buffer)Return a byte array from the given byte array buffer, at the offset of this field.byte[]getByteArray(byte[] buffer, int bufOffset)Return a byte array from the given byte array buffer, at the bufOffset + offset of this field.intgetByteLength()Answer the length of the field described by the receiverintgetOffset()Answer the offset of this field into some array of bytesvoidputByteArray(byte[] valueBytes, byte[] buffer)Put a byte array into the given buffer, at the offset of this field.voidputByteArray(byte[] valueBytes, byte[] buffer, int bufOffset)Put a byte array into the given buffer, starting at the specified offset in the buffer.voidputByteArray(byte[] valueBytes, int valueBytesOffset, byte[] buffer)Put a byte array into the given buffer, starting at an offset in the valueByte array.voidputByteArray(byte[] valueBytes, int valueBytesOffset, byte[] buffer, int bufOffset)Put a byte array into the given buffer, starting at an offset in the valueByte array and at the specified offset in the buffer.voidsetByteLength(int len)Sets the byte length of the fieldvoidsetOffset(int offset)
-
-
-
Constructor Detail
-
ByteArrayField
public ByteArrayField(int offset, int length)Construct an instance.- Parameters:
offset- int the offset in some byte array to the start of this field.length- int the size of the field in bytes
-
-
Method Detail
-
getByteLength
public int getByteLength()
Description copied from interface:FieldAnswer the length of the field described by the receiver- Specified by:
getByteLengthin interfaceField- Returns:
- int
- See Also:
Field.getByteLength()
-
setByteLength
public void setByteLength(int len)
Sets the byte length of the field
-
getOffset
public int getOffset()
Description copied from interface:FieldAnswer the offset of this field into some array of bytes- Specified by:
getOffsetin interfaceField- Returns:
- int
- See Also:
Field.getOffset()
-
setOffset
public void setOffset(int offset)
- Specified by:
setOffsetin interfaceField- See Also:
Field.setOffset(int)
-
getByteArray
public byte[] getByteArray(byte[] buffer)
Return a byte array from the given byte array buffer, at the offset of this field.- Parameters:
buffer- the underlying byte array- Returns:
- byte[]
-
getByteArray
public byte[] getByteArray(byte[] buffer, int bufOffset)Return a byte array from the given byte array buffer, at the bufOffset + offset of this field.- Parameters:
buffer- the underlying byte arraybufOffset- the additional offset into the byte array- Returns:
- byte[]
-
putByteArray
public void putByteArray(byte[] valueBytes, byte[] buffer)Put a byte array into the given buffer, at the offset of this field.- Parameters:
valueBytes- the byte array to putbuffer- the destination byte array
-
putByteArray
public void putByteArray(byte[] valueBytes, int valueBytesOffset, byte[] buffer)Put a byte array into the given buffer, starting at an offset in the valueByte array.- Parameters:
valueBytes- the byte array to putvalueBytesOffset- the offset into the valueByte arraybuffer- the destination byte array
-
putByteArray
public void putByteArray(byte[] valueBytes, byte[] buffer, int bufOffset)Put a byte array into the given buffer, starting at the specified offset in the buffer.- Parameters:
valueBytes- the byte array to putbuffer- the destination byte arraybufOffset- the offset into the buffer
-
putByteArray
public void putByteArray(byte[] valueBytes, int valueBytesOffset, byte[] buffer, int bufOffset)Put a byte array into the given buffer, starting at an offset in the valueByte array and at the specified offset in the buffer.- Parameters:
valueBytes- the byte array to putvalueBytesOffset- the offset into the valueByte arraybuffer- the destination byte arraybufOffset- the offset into the buffer
-
equals
public boolean equals(byte[] ba1, byte[] ba2)Compare two byte arrays, possible null, for equality.- Parameters:
ba1- byte[]ba2- byte[]- Returns:
- boolean true if equal, false otherwise
-
-