org.rrd4j.core

## Class RrdByteArrayBackend

- java.lang.Object
- - org.rrd4j.core.RrdBackend
  - - org.rrd4j.core.ByteBufferBackend
    - - org.rrd4j.core.RrdByteArrayBackend

-     public abstract class RrdByteArrayBackend
      extends ByteBufferBackend

  Abstract byte array based backend.

- - ### Field Summary

    - ### Fields inherited from class org.rrd4j.core.RrdBackend

      `BYTEORDER`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `RrdByteArrayBackend(String path)` Constructor for RrdByteArrayBackend.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected byte[]` | `getBuffer()`
    `long` | `getLength()` Returns the number of RRD bytes in the underlying storage.
    `protected void` | `read(long offset, byte[] bytes)` read.
    `protected void` | `setBuffer(byte[] buffer)`
    `protected void` | `setLength(long length)` Sets the number of bytes in the underlying RRD storage.

    - ### Methods inherited from class org.rrd4j.core.ByteBufferBackend

      `close, getCharBuffer, isDirty, readDouble, readDouble, readInt, readLong, readShort, rrdClose, setByteBuffer, write, writeDouble, writeDouble, writeDouble, writeInt, writeLong, writeShort, writeString`

    - ### Methods inherited from class org.rrd4j.core.RrdBackend

      `done, getFactory, getPath, getUri, isCachingAllowed, isInstanceCreated, readAll, readString, writeString`

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

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

- - ### Constructor Detail

    - #### RrdByteArrayBackend

          protected RrdByteArrayBackend(String path)

      Constructor for RrdByteArrayBackend.
      Parameters:
        `path` - a `String` object.

  - ### Method Detail

    - #### getBuffer

          protected byte[] getBuffer()

    - #### getLength

          public long getLength()

      Returns the number of RRD bytes in the underlying storage.
      Specified by:
        `getLength` in class `RrdBackend`
      Returns:
        Number of RRD bytes held in memory.

    - #### read

          protected void read(long offset,
                              byte[] bytes)
                       throws IOException

      read.
      Overrides:
        `read` in class `ByteBufferBackend`
      Parameters:
        `offset` - a long.
        `bytes` - an array of byte.
      Throws:
        `IOException` - if any.
        `IllegalArgumentException` - if offset is bigger that the possible length.

    - #### setBuffer

          protected void setBuffer(byte[] buffer)

    - #### setLength

          protected void setLength(long length)

      Sets the number of bytes in the underlying RRD storage. This method is called only once, immediately after a new RRD storage gets created.

      It will reserves a memory section as a RRD storage.

      Specified by:
        `setLength` in class `RrdBackend`
      Parameters:
        `length` - Length of the underlying RRD storage in bytes.