Class Serializers.IntSerializer

java.lang.Object
com.complexible.common.primitives.Serializers.IntSerializer
Enclosing class:
Serializers

public static final class Serializers.IntSerializer extends Object
Serializer for primitive integer values.
Author:
Evren Sirin
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IntSerializer

      public IntSerializer()
  • Method Details

    • serialize

      public byte[] serialize(int value)
      Serializes the given integer to 4 bytes.
    • serialize

      public void serialize(int value, byte[] bytes, int offset) throws ArrayIndexOutOfBoundsException
      Serializes the given integer to 4 bytes in the given byte array starting from the given offset.
      Throws:
      ArrayIndexOutOfBoundsException
    • deserialize

      public int deserialize(byte[] bytes) throws ArrayIndexOutOfBoundsException
      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.