Class IntegerField

  • All Implemented Interfaces:
    FixedField

    public class IntegerField
    extends Object
    implements FixedField
    representation of an integer (32-bit) field at a fixed location within a byte array
    • Constructor Summary

      Constructors 
      Constructor Description
      IntegerField​(int offset)
      construct the IntegerField with its offset into its containing byte array
      IntegerField​(int offset, byte[] data)
      Construct the IntegerField with its offset into its containing byte array and initialize its value from its byte array
      IntegerField​(int offset, int value)
      construct the IntegerField with its offset into its containing byte array and initialize its value
      IntegerField​(int offset, int value, byte[] data)
      construct the IntegerField with its offset into its containing byte array, initialize its value, and write the value to a byte array
    • Constructor Detail

      • IntegerField

        public IntegerField​(int offset,
                            int value)
                     throws ArrayIndexOutOfBoundsException
        construct the IntegerField 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 the offset is negative
      • IntegerField

        public IntegerField​(int offset,
                            byte[] data)
                     throws ArrayIndexOutOfBoundsException
        Construct the IntegerField 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)
      • IntegerField

        public IntegerField​(int offset,
                            int value,
                            byte[] data)
                     throws ArrayIndexOutOfBoundsException
        construct the IntegerField with its offset into its containing byte array, initialize its value, and write the value to a 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 the offset is negative or too large