java.lang.Object
net.metanotion.io.data.UTF8StringBytes
- All Implemented Interfaces:
Serializer<String>
String serializer using UTF-8 encoding.
Converts between String objects and UTF-8 byte arrays. Supports full Unicode character set for internationalized text.
UTF-8 encoding characteristics:
- ASCII characters (U+0000 to U+007F) use 1 byte
- Latin characters with diacritics (U+0080 to U+07FF) use 2 bytes
- Most common characters including CJK (U+0800 to U+FFFF) use 3 bytes
- Astral plane characters (U+10000 to U+10FFFF) use 4 bytes
Constructor Summary
ConstructorsConstructorDescriptionThe codec holds no state - UTF-8 is named on every call - so a bare instance is ready to serialise.Method Summary
All Methods
Constructor Details
UTF8StringBytes
public UTF8StringBytes()The codec holds no state - UTF-8 is named on every call - so a bare instance is ready to serialise.
Method Details
getBytes
Description copied from interface:Serializero).- Specified by:
getBytesin interfaceSerializer<String>- Parameters:
o- the object to serialize- Returns:
- the given object's serialized form as a byte array
construct
Description copied from interface:Serializerb).- Specified by:
constructin interfaceSerializer<String>- Parameters:
b- the serialized bytes to read back- Returns:
- the deserialized object