Class RrdByteArrayBackend


public abstract class RrdByteArrayBackend
extends ByteBufferBackend
Abstract byte array based backend.
  • Constructor Details

  • Method Details

    • setBuffer

      protected void setBuffer​(byte[] buffer)
    • getBuffer

      protected byte[] getBuffer()
    • 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.
    • 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.
    • setLength

      protected void setLength​(long length) throws IOException
      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.
      Throws:
      IllegalArgumentException - if length is bigger that the possible length.
      IOException - Thrown in case of I/O error.