Package io.datarouter.bytes
Class BinaryDictionary
java.lang.Object
io.datarouter.bytes.BinaryDictionary
Encodes key/value pairs to a flattened byte[].
Keys are sorted via Arrays::compareUnsigned.
Duplicate keys are rejected.
Size and lengths are encoded with variable lenght ints.
Format:
[size] (number of entries)
[keyLen0][key0][valLen0][val0]
[keyLen1][key1][valLen1][val1]
[etc]
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
CODEC
-
-
Constructor Details
-
BinaryDictionary
public BinaryDictionary()
-
-
Method Details
-
put
-
put
-
put
-
size
public int size() -
get
public byte[] get(byte[] key) -
get
-
find
-
find
-
findStringValue
-
equals
-
hashCode
-
encodedLength
public int encodedLength() -
encode
public byte[] encode() -
decode
-
toStringStringKeysAndHexValues
-