org.apache.directory.mavibot.btree.serializer

## Class ByteSerializer

- java.lang.Object
- - org.apache.directory.mavibot.btree.serializer.AbstractElementSerializer<Byte>
  - - org.apache.directory.mavibot.btree.serializer.ByteSerializer

- All Implemented Interfaces:
    ElementSerializer<Byte>

      public class ByteSerializer
      extends AbstractElementSerializer<Byte>

  The Byte serializer.
  Author:
    Apache Directory Project

- - ### Field Summary

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

  - ### Method Summary

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

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

      A static instance of a ByteSerializer

  - ### Method Detail

    - #### serialize

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

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

    - #### serialize

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

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

    - #### deserialize

          public static Byte deserialize(byte[] in)

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

    - #### deserialize

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

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

    - #### fromBytes

          public Byte fromBytes(byte[] in)

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

    - #### fromBytes

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

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

    - #### deserialize

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

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