Package io.sbk.data.impl
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.
-
Field Summary
Fields inherited from interface io.sbk.data.DataType
TIME_HEADER_BYTES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.protobuf.ByteStringallocate(int size) Create byte array data.com.google.protobuf.ByteStringcreate(int size) Create byte array data and fill the random data.longgetTime(@NotNull com.google.protobuf.ByteString data) Get the time of data.intGet minimum Write and Read Data Size.intlength(@NotNull com.google.protobuf.ByteString data) Get the size of the given data in terms of number of bytes for writers.com.google.protobuf.ByteStringsetTime(@NotNull com.google.protobuf.ByteString data, long time) Set the time for data.
-
Constructor Details
-
ProtoBufByteString
public ProtoBufByteString()
-
-
Method Details
-
allocate
public com.google.protobuf.ByteString allocate(int size) Create byte array data. -
create
public com.google.protobuf.ByteString create(int size) Create byte array data and fill the random 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. -
setTime
public com.google.protobuf.ByteString setTime(@NotNull @NotNull com.google.protobuf.ByteString data, long time) Set the time for data. -
getTime
public long getTime(@NotNull @NotNull com.google.protobuf.ByteString data) Get the time of data.- Specified by:
getTimein interfaceDataType<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:
getWriteReadMinSizein interfaceDataType<com.google.protobuf.ByteString>- Returns:
- int minimum data size Write and Read.
-