RrdMemoryBackend
Keywords: org.jrobin.core.RrdMemoryBackend class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jrobin.core
Class RrdMemoryBackend

    java.lang.Object
      org.jrobin.core.RrdBackend
          org.jrobin.core.RrdMemoryBackend

public class RrdMemoryBackend
extends RrdBackend

Backend which is used to store all RRD bytes in memory.

Constructor Summary
`protected` | `RrdMemoryBackend(java.lang.String path)`

Method Summary
`void` | `close()` This method is required by the base class definition, but it does not releases any memory resources at all.
`long` | `getLength()` Returns the number of RRD bytes held in memory.
`protected void` | `read(long offset, byte[] b)` Reads an array of bytes from the underlying storage starting from the given storage offset.
`protected void` | `setLength(long newLength)` Reserves a memory section as a RRD storage.
`protected void` | `write(long offset, byte[] b)` Writes an array of bytes to the underlying storage starting from the given storage offset.

Methods inherited from class org.jrobin.core.RrdBackend
`afterCreate, afterFetch, afterUpdate, beforeFetch, beforeUpdate, getPath, readAll, sync`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RrdMemoryBackend

    protected RrdMemoryBackend(java.lang.String path)

Method Detail

### write

    protected void write(long offset,
                         byte[] b)
                  throws java.io.IOException

  Description copied from class: `RrdBackend`
  Writes an array of bytes to the underlying storage starting from the given storage offset.

  Specified by:
    `write` in class `RrdBackend`
  Parameters:
    `offset` - Storage offset.
    `b` - Array of bytes that should be copied to the underlying storage
  Throws:
    `java.io.IOException` - Thrown in case of I/O error

### read

    protected void read(long offset,
                        byte[] b)
                 throws java.io.IOException

  Description copied from class: `RrdBackend`
  Reads an array of bytes from the underlying storage starting from the given storage offset.

  Specified by:
    `read` in class `RrdBackend`
  Parameters:
    `offset` - Storage offset.
    `b` - Array which receives bytes from the underlying storage
  Throws:
    `java.io.IOException` - Thrown in case of I/O error

### getLength

    public long getLength()

  Returns the number of RRD bytes held in memory.

  Specified by:
    `getLength` in class `RrdBackend`
  Returns:
    Number of all RRD bytes.

### setLength

    protected void setLength(long newLength)
                      throws java.io.IOException

  Reserves a memory section as a RRD storage.

  Specified by:
    `setLength` in class `RrdBackend`
  Parameters:
    `newLength` - Number of bytes held in memory.
  Throws:
    `java.io.IOException` - Thrown in case of I/O error.

### close

    public void close()

  This method is required by the base class definition, but it does not releases any memory resources at all.

  Overrides:
    `close` in class `RrdBackend`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD