B - the binary representation we're manipulating. This API is designed with a mutable
implementation in mind (because that is what the core driver is using). If you want to use an
immutable type, write a mutable wrapper for it.public interface PrimitiveCodec<B>
B.| Modifier and Type | Method and Description |
|---|---|
B |
allocate(int size) |
B |
concat(B left,
B right) |
void |
markReaderIndex(B source) |
byte |
readByte(B source) |
ByteBuffer |
readBytes(B source) |
default Map<String,ByteBuffer> |
readBytesMap(B source) |
default InetSocketAddress |
readInet(B source) |
InetAddress |
readInetAddr(B source) |
int |
readInt(B source) |
int |
readInt(B source,
int offset)
Reads an int at the given offset (relative to the current read index).
|
long |
readLong(B source) |
String |
readLongString(B source) |
B |
readRetainedSlice(B source,
int sliceLength)
Returns a view of the next
sliceLength bytes. |
byte[] |
readShortBytes(B source) |
String |
readString(B source) |
default List<String> |
readStringList(B source) |
default Map<String,String> |
readStringMap(B source) |
default Map<String,List<String>> |
readStringMultimap(B source) |
int |
readUnsignedShort(B source) |
default UUID |
readUuid(B source) |
void |
release(B toRelease)
"Releases" an element if the underlying implementation uses reference counting to manage memory
allocation.
|
void |
resetReaderIndex(B source) |
int |
sizeOf(B toMeasure)
The number of readable bytes in the given element.
|
void |
updateCrc(B source,
CRC32 crc)
Feeds all available bytes into the given CRC.
|
void |
writeByte(byte b,
B dest) |
void |
writeBytes(byte[] bytes,
B dest) |
void |
writeBytes(ByteBuffer bytes,
B dest) |
default void |
writeBytesMap(Map<String,ByteBuffer> m,
B dest) |
default void |
writeInet(InetSocketAddress address,
B dest) |
void |
writeInetAddr(InetAddress address,
B dest) |
void |
writeInt(int i,
B dest) |
void |
writeLong(long l,
B dest) |
void |
writeLongString(String s,
B dest) |
void |
writeShortBytes(byte[] bytes,
B dest) |
void |
writeString(String s,
B dest) |
default void |
writeStringList(List<String> l,
B dest) |
default void |
writeStringMap(Map<String,String> m,
B dest) |
default void |
writeStringMultimap(Map<String,List<String>> m,
B dest) |
void |
writeUnsignedShort(int i,
B dest) |
default void |
writeUuid(UUID uuid,
B dest) |
B allocate(int size)
void release(B toRelease)
int sizeOf(B toMeasure)
void markReaderIndex(B source)
void resetReaderIndex(B source)
byte readByte(B source)
int readInt(B source)
int readInt(B source, int offset)
InetAddress readInetAddr(B source)
long readLong(B source)
int readUnsignedShort(B source)
ByteBuffer readBytes(B source)
byte[] readShortBytes(B source)
B readRetainedSlice(B source, int sliceLength)
sliceLength bytes. This consumes the bytes (the next reads
must return the data after the slice). If the underlying implementation uses reference counting
to manage memory allocation, this must also "retain" the slice, so that it doesn't get recycled
if source is released.void updateCrc(B source, CRC32 crc)
default Map<String,ByteBuffer> readBytesMap(B source)
default InetSocketAddress readInet(B source)
void writeByte(byte b,
B dest)
void writeInt(int i,
B dest)
void writeInetAddr(InetAddress address, B dest)
void writeLong(long l,
B dest)
void writeUnsignedShort(int i,
B dest)
void writeBytes(ByteBuffer bytes, B dest)
void writeBytes(byte[] bytes,
B dest)
void writeShortBytes(byte[] bytes,
B dest)
default void writeBytesMap(Map<String,ByteBuffer> m, B dest)
default void writeInet(InetSocketAddress address, B dest)
Copyright © 2017–2022. All rights reserved.