Package io.sbk.data.impl
Class NioByteBuffer
java.lang.Object
io.sbk.data.impl.NioByteBuffer
- All Implemented Interfaces:
DataType<ByteBuffer>
Class for processing ByteBuffer data.
-
Field Summary
Fields inherited from interface io.sbk.data.DataType
TIME_HEADER_BYTES
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionallocate
(int size) Create byte buffer.create
(int size) Create byte buffer data and will with random data.long
getTime
(@NotNull ByteBuffer data) Get the time of data.int
Get minimum Write and Read Data Size.int
length
(@NotNull ByteBuffer data) Get the size of the given data in terms of number of bytes, for writers.setTime
(@NotNull ByteBuffer data, long time) Set the time for data.
-
Constructor Details
-
NioByteBuffer
public NioByteBuffer()
-
-
Method Details
-
allocate
Create byte buffer.- Specified by:
allocate
in interfaceDataType<ByteBuffer>
- Parameters:
size
- size (number of bytes) of the data to create.- Returns:
- T return the data.
-
create
Create byte buffer data and will with random data.- Specified by:
create
in interfaceDataType<ByteBuffer>
- Parameters:
size
- size (number of bytes) of the data to create.- Returns:
- T return the data.
-
length
Get the size of the given data in terms of number of bytes, for writers.- Specified by:
length
in interfaceDataType<ByteBuffer>
- Parameters:
data
- data- Returns:
- return size of the data.
-
setTime
Set the time for data.- Specified by:
setTime
in interfaceDataType<ByteBuffer>
- Parameters:
data
- datatime
- time to set- Returns:
- ByteBuffer return the data.
-
getTime
Get the time of data.- Specified by:
getTime
in interfaceDataType<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 interfaceDataType<ByteBuffer>
- Returns:
- int minimum data size Write and Read.
-