db4o 7.4

com.db4o.io
Class IoAdapter

java.lang.Object
  extended by com.db4o.io.IoAdapter
Direct Known Subclasses:
CachedIoAdapter, MemoryIoAdapter, RandomAccessFileAdapter, VanillaIoAdapter

public abstract class IoAdapter
extends java.lang.Object

Base class for database file adapters, both for file and memory databases.


Constructor Summary
IoAdapter()
           
 
Method Summary
 void blockCopy(int oldAddress, int oldAddressOffset, int newAddress, int newAddressOffset, int length)
          copies a block within a file in block mode
 void blockSeek(int address)
          sets the read/write pointer in the file using block mode
 void blockSeek(int address, int offset)
          sets the read/write pointer in the file using block mode
 int blockSize()
          returns the block size currently used
 void blockSize(int blockSize)
          outside call to set the block size of this adapter
abstract  void close()
          implement to close the adapter
 void copy(long oldAddress, long newAddress, int length)
          copies a block within a file in absolute mode
 IoAdapter delegatedIoAdapter()
          Delegated IO Adapter
abstract  void delete(java.lang.String path)
          deletes the given path from whatever 'file system' is addressed
abstract  boolean exists(java.lang.String path)
          checks whether a file exists
abstract  long getLength()
          implement to return the absolute length of the file
abstract  IoAdapter open(java.lang.String path, boolean lockFile, long initialLength, boolean readOnly)
          implement to open the file
 int read(byte[] buffer)
          reads a buffer at the seeked address
abstract  int read(byte[] bytes, int length)
          implement to read a buffer at the seeked address
abstract  void seek(long pos)
          implement to set the read/write pointer in the file, absolute mode
abstract  void sync()
          implement to flush the file contents to storage
 void write(byte[] bytes)
          writes a buffer to the seeked address
abstract  void write(byte[] buffer, int length)
          implement to write a buffer at the seeked address
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IoAdapter

public IoAdapter()
Method Detail

blockCopy

public void blockCopy(int oldAddress,
                      int oldAddressOffset,
                      int newAddress,
                      int newAddressOffset,
                      int length)
               throws Db4oIOException
copies a block within a file in block mode

Throws:
Db4oIOException

blockSeek

public void blockSeek(int address)
               throws Db4oIOException
sets the read/write pointer in the file using block mode

Throws:
Db4oIOException

blockSeek

public void blockSeek(int address,
                      int offset)
               throws Db4oIOException
sets the read/write pointer in the file using block mode

Throws:
Db4oIOException

blockSize

public void blockSize(int blockSize)
outside call to set the block size of this adapter


close

public abstract void close()
                    throws Db4oIOException
implement to close the adapter

Throws:
Db4oIOException

copy

public void copy(long oldAddress,
                 long newAddress,
                 int length)
          throws Db4oIOException
copies a block within a file in absolute mode

Throws:
Db4oIOException

delete

public abstract void delete(java.lang.String path)
deletes the given path from whatever 'file system' is addressed


exists

public abstract boolean exists(java.lang.String path)
checks whether a file exists


getLength

public abstract long getLength()
                        throws Db4oIOException
implement to return the absolute length of the file

Throws:
Db4oIOException

open

public abstract IoAdapter open(java.lang.String path,
                               boolean lockFile,
                               long initialLength,
                               boolean readOnly)
                        throws Db4oIOException
implement to open the file

Throws:
Db4oIOException

read

public int read(byte[] buffer)
         throws Db4oIOException
reads a buffer at the seeked address

Returns:
the number of bytes read and returned
Throws:
Db4oIOException

read

public abstract int read(byte[] bytes,
                         int length)
                  throws Db4oIOException
implement to read a buffer at the seeked address

Throws:
Db4oIOException

seek

public abstract void seek(long pos)
                   throws Db4oIOException
implement to set the read/write pointer in the file, absolute mode

Throws:
Db4oIOException

sync

public abstract void sync()
                   throws Db4oIOException
implement to flush the file contents to storage

Throws:
Db4oIOException

write

public void write(byte[] bytes)
           throws Db4oIOException
writes a buffer to the seeked address

Throws:
Db4oIOException

write

public abstract void write(byte[] buffer,
                           int length)
                    throws Db4oIOException
implement to write a buffer at the seeked address

Throws:
Db4oIOException

blockSize

public int blockSize()
returns the block size currently used


delegatedIoAdapter

public IoAdapter delegatedIoAdapter()
Delegated IO Adapter

Returns:
reference to itself

db4o 7.4

Copyright 2007 db4objects Inc. All rights reserved.