org.apache.directory.mavibot.btree.serializer

## Class LongArraySerializer

- java.lang.Object
- - org.apache.directory.mavibot.btree.serializer.AbstractElementSerializer<long[]>
  - - org.apache.directory.mavibot.btree.serializer.LongArraySerializer

- All Implemented Interfaces:
    ElementSerializer<long[]>

      public class LongArraySerializer
      extends AbstractElementSerializer<long[]>

  A serializer for a Long[].
  Author:
    Apache Directory Project

- - ### Field Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compare(long[] type1, long[] type2)` Returns the comparison of two types.
    `long[]` | `deserialize(BufferHandler bufferHandler)` Deserialize an element from a BufferHandler
    `long[]` | `deserialize(ByteBuffer buffer)` Deserialize an element from a ByteBuffer
    `long[]` | `fromBytes(byte[] buffer)` Deserialize an element from a byte[]
    `long[]` | `fromBytes(byte[] buffer, int pos)` Deserialize an element from a byte[]
    `byte[]` | `serialize(long[] element)` Produce the byte[] representation of the element

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

      `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 LongArraySerializer INSTANCE

      A static instance of a LongArraySerializer

  - ### 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

    - #### 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

    - #### compare

          public int compare(long[] type1,
                    long[] type2)

      Returns the comparison of two types.
      - If type1 < type2, return -1
      - If type1 > type2, return 1
      - If type1 == type2, return 0
      Specified by:
        `compare` in interface `ElementSerializer<long[]>`
      Overrides:
        `compare` in class `AbstractElementSerializer<long[]>`
      Parameters:
        `type1` - The first type to compare
        `type2` - The second type to compare
      Returns:
        The comparison result

    - #### fromBytes

          public long[] fromBytes(byte[] buffer)
                           throws IOException

      Description copied from interface: `ElementSerializer`
      Deserialize an element from a byte[]
      Parameters:
        `buffer` - The incoming byte[]
      Returns:
        The deserialized element
      Throws:
        `IOException` - If the deserialization failed

    - #### fromBytes

          public long[] fromBytes(byte[] buffer,
                         int pos)
                           throws IOException

      Description copied from interface: `ElementSerializer`
      Deserialize an element from a byte[]
      Parameters:
        `buffer` - The incoming byte[]
      Returns:
        The deserialized element
      Throws:
        `IOException` - If the deserialization failed

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