Class ProtoBufByteString

java.lang.Object
io.sbk.data.impl.ProtoBufByteString
All Implemented Interfaces:
DataType<com.google.protobuf.ByteString>

public final class ProtoBufByteString extends Object implements DataType<com.google.protobuf.ByteString>
Class for processing Byte String data.
  • Constructor Details

    • ProtoBufByteString

      public ProtoBufByteString()
      Creates a protobuf byte-string data generator.
  • Method Details

    • allocate

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

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

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

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

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

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