Package io.sbk.data

Interface DataType<T>

All Known Implementing Classes:
ByteArray, NioByteBuffer, ProtoBufByteString, SbkString

public interface DataType<T>
Interface for Data Type operations.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    TIME_HEADER_BYTES = 8;.
  • Method Summary

    Modifier and Type
    Method
    Description
    allocate(int size)
    allocate the data.
    create(int size)
    Create the data with payload content.
    long
    getTime(T data)
    Get the time of data.
    int
    Get minimum Write and Read Data Size.
    int
    length(T data)
    Get the size of the given data in terms of number of bytes.
    setTime(T data, long time)
    Set the time for data.
  • Field Details

    • TIME_HEADER_BYTES

      static final int TIME_HEADER_BYTES
      TIME_HEADER_BYTES = 8;.
      See Also:
  • Method Details

    • allocate

      T allocate(int size)
      allocate the data.
      Parameters:
      size - size (number of bytes) of the data to create.
      Returns:
      T return the data.
    • create

      T create(int size)
      Create the data with payload content.
      Parameters:
      size - size (number of bytes) of the data to create.
      Returns:
      T return the data.
    • length

      int length(T data)
      Get the size of the given data in terms of number of bytes.
      Parameters:
      data - data
      Returns:
      return size of the data.
    • setTime

      T setTime(T data, long time)
      Set the time for data.
      Parameters:
      data - data
      time - time to set
      Returns:
      T return the data.
    • getTime

      long getTime(T data)
      Get the time of data.
      Parameters:
      data - data
      Returns:
      long return the time set by last setTime(Object, long)}.
    • getWriteReadMinSize

      int getWriteReadMinSize()
      Get minimum Write and Read Data Size.
      Returns:
      int minimum data size Write and Read.