org.apache.directory.mavibot.btree.serializer

## Class IntSerializer

- java.lang.Object
- - org.apache.directory.mavibot.btree.serializer.AbstractElementSerializer<Integer>
  - - org.apache.directory.mavibot.btree.serializer.IntSerializer

- All Implemented Interfaces:
    ElementSerializer<Integer>

      public class IntSerializer
      extends AbstractElementSerializer<Integer>

  The Integer serializer.
  Author:
    Apache Directory Project

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static IntSerializer` | `INSTANCE` A static instance of a IntSerializer

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Integer` | `deserialize(BufferHandler bufferHandler)` Deserialize an element from a BufferHandler
    `static Integer` | `deserialize(byte[] in)` A static method used to deserialize an Integer from a byte array.
    `static Integer` | `deserialize(byte[] in, int start)` A static method used to deserialize an Integer from a byte array.
    `Integer` | `deserialize(ByteBuffer buffer)` Deserialize an element from a ByteBuffer
    `Integer` | `fromBytes(byte[] in)` A method used to deserialize an Integer from a byte array.
    `Integer` | `fromBytes(byte[] in, int start)` A method used to deserialize an Integer from a byte array.
    `static byte[]` | `serialize(byte[] buffer, int start, int value)` Serialize an int
    `static byte[]` | `serialize(int value)` Serialize an int
    `byte[]` | `serialize(Integer element)` Produce the byte[] representation of the element

    - ### Methods inherited from class org.apache.directory.mavibot.btree.serializer.AbstractElementSerializer

      `compare, getComparator, getType`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### INSTANCE

          public static final IntSerializer INSTANCE

      A static instance of a IntSerializer

  - ### Method Detail

    - #### deserialize

          public static Integer deserialize(byte[] in)

      A static method used to deserialize an Integer from a byte array.
      Parameters:
        `in` - The byte array containing the Integer
      Returns:
        An Integer

    - #### deserialize

          public static Integer deserialize(byte[] in,
                            int start)

      A static method used to deserialize an Integer from a byte array.
      Parameters:
        `in` - The byte array containing the Integer
        `start` - the position in the byte[] we will deserialize the int from
      Returns:
        An Integer

    - #### fromBytes

          public Integer fromBytes(byte[] in)

      A method used to deserialize an Integer from a byte array.
      Parameters:
        `in` - The byte array containing the Integer
      Returns:
        An Integer

    - #### fromBytes

          public Integer fromBytes(byte[] in,
                          int start)

      A method used to deserialize an Integer from a byte array.
      Parameters:
        `in` - The byte array containing the Integer
        `start` - the position in the byte[] we will deserialize the int from
      Returns:
        An Integer

    - #### deserialize

          public Integer deserialize(ByteBuffer buffer)
                              throws IOException

      Deserialize an element from a ByteBuffer
      Parameters:
        `buffer` - The incoming ByteBuffer
      Returns:
        The deserialized element
      Throws:
        `IOException` - If the deserialization failed

    - #### deserialize

          public Integer deserialize(BufferHandler bufferHandler)
                              throws IOException

      Deserialize an element from a BufferHandler
      Parameters:
        `bufferHandler` - The incoming bufferHandler
      Returns:
        The deserialized element
      Throws:
        `IOException` - If the deserialization failed

    - #### serialize

          public byte[] serialize(Integer element)

      Produce the byte[] representation of the element
      Parameters:
        `element` - The element to serialize
      Returns:
        The byte[] containing the serialized element

    - #### serialize

          public static byte[] serialize(int value)

      Serialize an int
      Parameters:
        `value` - the value to serialize
      Returns:
        The byte[] containing the serialized int

    - #### serialize

          public static byte[] serialize(byte[] buffer,
                         int start,
                         int value)

      Serialize an int
      Parameters:
        `buffer` - the Buffer that will contain the serialized value
        `start` - the position in the buffer we will store the serialized int
        `value` - the value to serialize
      Returns:
        The byte[] containing the serialized int

Copyright © 2012–2015 Apache Mavibot Project Parent. All rights reserved.