org.apache.directory.mavibot.btree.serializer

## Class BufferHandler

- java.lang.Object
- - org.apache.directory.mavibot.btree.serializer.BufferHandler

-     public class BufferHandler
      extends Object

  A class used to hide the buffer read from the underlying file.
  Author:
    Apache Directory Project

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BufferHandler(byte[] buffer)` Create a new BufferHandler
    `BufferHandler(FileChannel channel, ByteBuffer buffer)` Create a new BufferHandler

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `getBuffer()`
    `byte[]` | `read(int len)` Read a buffer containing the given number of bytes

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

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

- - ### Constructor Detail

    - #### BufferHandler

          public BufferHandler(byte[] buffer)

      Create a new BufferHandler
      Parameters:
        `buffer` - The buffer used to transfer data

    - #### BufferHandler

          public BufferHandler(FileChannel channel,
                       ByteBuffer buffer)

      Create a new BufferHandler
      Parameters:
        `channel` - The channel to read
        `buffer` - The buffer used to transfer data

  - ### Method Detail

    - #### getBuffer

          public byte[] getBuffer()

    - #### read

          public byte[] read(int len)
                      throws IOException

      Read a buffer containing the given number of bytes
      Parameters:
        `len` - The number of bytes to read
      Returns:
      Throws:
        `IOException`

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