Class ByteArrayRequest

java.lang.Object
com.mouseviator.fsuipc.datarequest.DataRequest
com.mouseviator.fsuipc.datarequest.primitives.ByteArrayRequest
All Implemented Interfaces:
IDataRequest<byte[]>

public class ByteArrayRequest
extends DataRequest
implements IDataRequest<byte[]>
This class implements byte array data request for use with FSUIPC class. It is for good use when reading/writing bigger chunks of data which we cannot wrap into primitive data types.
Author:
Mouseviator
  • Constructor Details

    • ByteArrayRequest

      public ByteArrayRequest​(int size)
      Creates a new byte array data request of specified size.
      Parameters:
      size - The number of bytes to allocate for this data request.
    • ByteArrayRequest

      public ByteArrayRequest​(int offset, int size) throws java.security.InvalidParameterException
      Creates a new byte array data request of specified size associated with given offset.
      Parameters:
      offset - An offset to associate this data request with.
      size - The number of bytes to allocate for this data request.
      Throws:
      java.security.InvalidParameterException
    • ByteArrayRequest

      public ByteArrayRequest​(int offset, byte[] data) throws java.security.InvalidParameterException
      Creates a new byte array data request associated with given offset and initialized with data from given byte array. This also sets the data request type to WRITE.
      Parameters:
      offset - An offset to associate this data request with.
      data - An actual data. Note that the array will not be copied, will be used directly.
      Throws:
      java.security.InvalidParameterException
  • Method Details

    • getValue

      public byte[] getValue()
      Description copied from interface: IDataRequest
      Returns the value stored within this data request byte data buffer.
      Specified by:
      getValue in interface IDataRequest<byte[]>
      Returns:
      The value stored within this data request.
    • setValue

      public void setValue​(byte[] value)
      Description copied from interface: IDataRequest
      Sets the value to be stored in the byte data buffer of this data request.
      Specified by:
      setValue in interface IDataRequest<byte[]>
      Parameters:
      value - The value to store.