Class ByteArray

java.lang.Object
io.sbk.data.impl.ByteArray
All Implemented Interfaces:
DataType<byte[]>

public final class ByteArray extends Object implements DataType<byte[]>
Class for processing byte[] data.
  • Constructor Details

    • ByteArray

      public ByteArray()
  • Method Details

    • allocate

      public byte[] allocate(int size)
      Create byte array data.
      Specified by:
      allocate in interface DataType<byte[]>
      Parameters:
      size - size (number of bytes) of the data to create.
      Returns:
      T return the data.
    • create

      public byte[] create(int size)
      Create byte array data and fill the random data.
      Specified by:
      create in interface DataType<byte[]>
      Parameters:
      size - size (number of bytes) of the data to create.
      Returns:
      T return the data.
    • length

      public int length(@NotNull @NotNull byte[] data)
      Get the size of the given data in terms of number of bytes for writers.
      Specified by:
      length in interface DataType<byte[]>
      Parameters:
      data - data
      Returns:
      return size of the data.
    • setTime

      public byte[] setTime(byte[] data, long time)
      Set the time for data.
      Specified by:
      setTime in interface DataType<byte[]>
      Parameters:
      data - data
      time - time to set
      Returns:
      byte[] return the data.
    • getTime

      public long getTime(byte[] data)
      Get the time of data.
      Specified by:
      getTime in interface DataType<byte[]>
      Parameters:
      data - data
      Returns:
      long return the time set by last setTime(byte[], long)} )}}.
    • getWriteReadMinSize

      public int getWriteReadMinSize()
      Get minimum Write and Read Data Size.
      Specified by:
      getWriteReadMinSize in interface DataType<byte[]>
      Returns:
      int minimum data size Write and Read.