db4o 6.1

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()
           
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)
          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 java.io.IOException
copies a block within a file in block mode

Throws:
java.io.IOException

blockSeek

public void blockSeek(int address)
               throws java.io.IOException
sets the read/write pointer in the file using block mode

Throws:
java.io.IOException

blockSeek

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

Throws:
java.io.IOException

blockSize

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


close

public abstract void close()
                    throws java.io.IOException
implement to close the adapter

Throws:
java.io.IOException

copy

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

Throws:
java.io.IOException

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 java.io.IOException
implement to return the absolute length of the file

Throws:
java.io.IOException

open

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

Throws:
java.io.IOException

read

public int read(byte[] buffer)
         throws java.io.IOException
reads a buffer at the seeked address

Returns:
the number of bytes read and returned
Throws:
java.io.IOException

read

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

Throws:
java.io.IOException

seek

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

Throws:
java.io.IOException

sync

public abstract void sync()
                   throws java.io.IOException
implement to flush the file contents to storage

Throws:
java.io.IOException

write

public void write(byte[] bytes)
           throws java.io.IOException
writes a buffer to the seeked address

Throws:
java.io.IOException

write

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

Throws:
java.io.IOException

blockSize

public int blockSize()
returns the block size currently used


delegatedIoAdapter

public IoAdapter delegatedIoAdapter()

db4o 6.1