Class NioByteBuffer

java.lang.Object
io.sbk.data.impl.NioByteBuffer
All Implemented Interfaces:
DataType<ByteBuffer>

public final class NioByteBuffer extends Object implements DataType<ByteBuffer>
Class for processing ByteBuffer data.
  • Constructor Details

    • NioByteBuffer

      public NioByteBuffer()
  • Method Details

    • allocate

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

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

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

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

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

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