Module ibm.jzos

Class ByteArrayField

java.lang.Object
com.ibm.jzos.fields.ByteArrayField
All Implemented Interfaces:
Field

public class ByteArrayField extends Object implements Field
A byte array Field.

Since:
2.1.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    ByteArrayField(int offset, int length)
    Construct an instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(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.
    int
    Answer the length of the field described by the receiver
    int
    Answer the offset of this field into some array of bytes
    void
    putByteArray(byte[] valueBytes, byte[] buffer)
    Put a byte array into the given buffer, at the offset of this field.
    void
    putByteArray(byte[] valueBytes, byte[] buffer, int bufOffset)
    Put a byte array into the given buffer, starting at the specified offset in the buffer.
    void
    putByteArray(byte[] valueBytes, int valueBytesOffset, byte[] buffer)
    Put a byte array into the given buffer, starting at an offset in the valueByte array.
    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.
    void
    setByteLength(int len)
    Sets the byte length of the field
    void
    setOffset(int offset)
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • 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 Details

    • getByteLength

      public int getByteLength()
      Description copied from interface: Field
      Answer the length of the field described by the receiver
      Specified by:
      getByteLength in interface Field
      Returns:
      int
      See Also:
    • setByteLength

      public void setByteLength(int len)
      Sets the byte length of the field
    • getOffset

      public int getOffset()
      Description copied from interface: Field
      Answer the offset of this field into some array of bytes
      Specified by:
      getOffset in interface Field
      Returns:
      int
      See Also:
    • setOffset

      public void setOffset(int offset)
      Specified by:
      setOffset in interface Field
      See Also:
    • 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 array
      bufOffset - 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 put
      buffer - 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 put
      valueBytesOffset - the offset into the valueByte array
      buffer - 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 put
      buffer - the destination byte array
      bufOffset - 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 put
      valueBytesOffset - the offset into the valueByte array
      buffer - the destination byte array
      bufOffset - 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