Package 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
-
Constructor Summary
Constructors Modifier Constructor Description protected
RrdByteArrayBackend(String path)
Constructor for RrdByteArrayBackend. -
Method Summary
Modifier and Type Method 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
-
Constructor Details
-
RrdByteArrayBackend
Constructor for RrdByteArrayBackend.
- Parameters:
path
- aString
object.
-
-
Method Details
-
setBuffer
protected void setBuffer(byte[] buffer) -
getBuffer
protected byte[] getBuffer() -
read
read.
- Overrides:
read
in classByteBufferBackend
- 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 classRrdBackend
- Returns:
- Number of RRD bytes held in memory.
-
setLength
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 classRrdBackend
- 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.
-