java.lang.Object
net.metanotion.io.data.IntBytes
- All Implemented Interfaces:
Serializer<Integer>
Integer serializer using 4-byte big-endian representation.
Converts between Integer objects and 4-byte big-endian arrays. Provides consistent byte ordering for cross-platform compatibility.
Serialization format:
- Byte 0: Most significant byte (bits 24-31)
- Byte 1: Second most significant byte (bits 16-23)
- Byte 2: Third most significant byte (bits 8-15)
- Byte 3: Least significant byte (bits 0-7)
Constructor Summary
ConstructorsMethod Summary
All Methods
Constructor Details
IntBytes
public IntBytes()Constructor. The conversion is a pure function of the value or the four bytes handed to it, so an instance carries no state.
Method Details
getBytes
Description copied from interface:Serializero).- Specified by:
getBytesin interfaceSerializer<Integer>- 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<Integer>- Parameters:
b- the serialized bytes to read back- Returns:
- the deserialized object