Class Serializers.IntSerializer
- java.lang.Object
-
- com.complexible.common.primitives.Serializers.IntSerializer
-
- Enclosing class:
- Serializers
public static final class Serializers.IntSerializer extends java.lang.Object
Serializer for primitive integer values.- Author:
- Evren Sirin
-
-
Constructor Summary
Constructors Constructor Description IntSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
deserialize(byte[] bytes)
Deserializes an integer value from the first 4 bytes of the given array.int
deserialize(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.void
serialize(int value, byte[] bytes, int offset)
Serializes the given integer to 4 bytes in the given byte array starting from the given offset.
-
-
-
Method Detail
-
serialize
public byte[] serialize(int value)
Serializes the given integer to 4 bytes.
-
serialize
public void serialize(int value, byte[] bytes, int offset) throws java.lang.ArrayIndexOutOfBoundsException
Serializes the given integer to 4 bytes in the given byte array starting from the given offset.- Throws:
java.lang.ArrayIndexOutOfBoundsException
-
deserialize
public int deserialize(byte[] bytes) throws java.lang.ArrayIndexOutOfBoundsException
Deserializes an integer value from the first 4 bytes of the given array.- Throws:
java.lang.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.
-
-