org.apache.directory.mavibot.btree.serializer

## Class LongSerializer

- java.lang.Object
- - org.apache.directory.mavibot.btree.serializer.AbstractElementSerializer<Long>
  - - org.apache.directory.mavibot.btree.serializer.LongSerializer

- All Implemented Interfaces:
    ElementSerializer<Long>

      public class LongSerializer
      extends AbstractElementSerializer<Long>

  The Long serializer.
  Author:
    Apache Directory Project

- - ### Field Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Long` | `deserialize(BufferHandler bufferHandler)` Deserialize an element from a BufferHandler
    `static Long` | `deserialize(byte[] in)` A static method used to deserialize a Long from a byte array.
    `static Long` | `deserialize(byte[] in, int start)` A static method used to deserialize an Integer from a byte array.
    `Long` | `deserialize(ByteBuffer buffer)` Deserialize an element from a ByteBuffer
    `Long` | `fromBytes(byte[] in)` A method used to deserialize a Long from a byte array.
    `Long` | `fromBytes(byte[] in, int start)` A method used to deserialize an Integer from a byte array.
    `static byte[]` | `serialize(byte[] buffer, int start, long value)` Serialize an long
    `static byte[]` | `serialize(long value)` Serialize an long
    `byte[]` | `serialize(Long 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 LongSerializer INSTANCE

      A static instance of a LongSerializer

  - ### Method Detail

    - #### serialize

          public byte[] serialize(Long 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(long value)

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

    - #### serialize

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

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

    - #### deserialize

          public static Long deserialize(byte[] in)

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

    - #### deserialize

          public static Long 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 long from
      Returns:
        An Integer

    - #### fromBytes

          public Long fromBytes(byte[] in)

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

    - #### fromBytes

          public Long 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 long from
      Returns:
        An Integer

    - #### deserialize

          public Long 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

    - #### deserialize

          public Long 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

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