public abstract class ByteBufferBackend extends RrdBackend
ByteBuffer
, using java internal methods for
long, integer and others types.BYTEORDER
Modifier | Constructor and Description |
---|---|
protected |
ByteBufferBackend(String path) |
Modifier and Type | Method and Description |
---|---|
protected void |
close()
Closes the underlying backend.
|
protected CharBuffer |
getCharBuffer(long offset,
int size)
Extract a CharBuffer from the backend, used by readString
|
protected boolean |
isDirty() |
protected void |
read(long offset,
byte[] b)
Reads a number of bytes from the RRD file on the disk
|
double |
readDouble(long offset) |
double[] |
readDouble(long offset,
int count) |
protected int |
readInt(long offset) |
protected long |
readLong(long offset) |
protected short |
readShort(long offset) |
protected void |
rrdClose()
Closes the underlying backend.
|
protected void |
setByteBuffer(ByteBuffer byteBuffer) |
protected void |
write(long offset,
byte[] b)
Writes bytes to the underlying RRD file on the disk
|
protected void |
writeDouble(long offset,
double value) |
protected void |
writeDouble(long offset,
double[] values) |
protected void |
writeDouble(long offset,
double value,
int count) |
protected void |
writeInt(long offset,
int value) |
protected void |
writeLong(long offset,
long value) |
protected void |
writeShort(long offset,
short value) |
protected void |
writeString(long offset,
String value,
int length) |
done, getFactory, getLength, getPath, getUri, isCachingAllowed, isInstanceCreated, readAll, readString, setLength, writeString
protected ByteBufferBackend(String path)
protected void setByteBuffer(ByteBuffer byteBuffer)
protected void write(long offset, byte[] b) throws IOException
write
in class RrdBackend
offset
- Starting file offsetb
- Bytes to be written.IOException
- if any.IllegalArgumentException
- if offset is bigger that the possible mapping position (2GiB).protected void writeShort(long offset, short value) throws IOException
writeShort
in class RrdBackend
IOException
protected void writeInt(long offset, int value) throws IOException
writeInt
in class RrdBackend
IOException
protected void writeLong(long offset, long value) throws IOException
writeLong
in class RrdBackend
IOException
protected void writeDouble(long offset, double value) throws IOException
writeDouble
in class RrdBackend
IOException
protected void writeDouble(long offset, double value, int count) throws IOException
writeDouble
in class RrdBackend
IOException
protected void writeDouble(long offset, double[] values) throws IOException
writeDouble
in class RrdBackend
IOException
protected void writeString(long offset, String value, int length) throws IOException
writeString
in class RrdBackend
IOException
protected void read(long offset, byte[] b) throws IOException
read
in class RrdBackend
offset
- Starting file offsetb
- Buffer which receives bytes read from the file.IOException
- Thrown in case of I/O error.IllegalArgumentException
- if offset is bigger that the possible mapping position (2GiB).protected short readShort(long offset) throws IOException
readShort
in class RrdBackend
IOException
protected int readInt(long offset) throws IOException
readInt
in class RrdBackend
IOException
protected long readLong(long offset) throws IOException
readLong
in class RrdBackend
IOException
public double readDouble(long offset) throws IOException
readDouble
in class RrdBackend
IOException
public double[] readDouble(long offset, int count) throws IOException
readDouble
in class RrdBackend
IOException
protected CharBuffer getCharBuffer(long offset, int size) throws RrdException
RrdBackend
getCharBuffer
in class RrdBackend
RrdException
protected void close() throws IOException
RrdBackend
close
in class RrdBackend
IOException
- Thrown in case of I/O errorprotected boolean isDirty()
protected void rrdClose() throws IOException
RrdBackend
RrdDb#close()
when it's closed. All subclass must keep calling it.rrdClose
in class RrdBackend
IOException
- Thrown in case of I/O error