Class Serializers.IntSerializer
java.lang.Object
com.complexible.common.primitives.Serializers.IntSerializer
- Enclosing class:
Serializers
Serializer for primitive integer values.
- Author:
- Evren Sirin
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdeserialize(byte[] bytes) Deserializes an integer value from the first 4 bytes of the given array.intdeserialize(byte[] bytes, int offset) Deserializes an integer value from 4 bytes of the given array starting at the given location.byte[]serialize(int value) Serializes the given integer to 4 bytes.voidserialize(int value, byte[] bytes, int offset) Serializes the given integer to 4 bytes in the given byte array starting from the given offset.
-
Constructor Details
-
IntSerializer
public IntSerializer()
-
-
Method Details
-
serialize
public byte[] serialize(int value) Serializes the given integer to 4 bytes. -
serialize
Serializes the given integer to 4 bytes in the given byte array starting from the given offset.- Throws:
ArrayIndexOutOfBoundsException
-
deserialize
Deserializes an integer value from the first 4 bytes of the given array.- Throws:
ArrayIndexOutOfBoundsException
-
deserialize
public int deserialize(byte[] bytes, int offset) Deserializes an integer value from 4 bytes of the given array starting at the given location.
-