db4o 7.4

com.db4o.io
Class RandomAccessFileAdapter

java.lang.Object
  extended by com.db4o.io.IoAdapter
      extended by com.db4o.io.RandomAccessFileAdapter
Direct Known Subclasses:
SymbianIoAdapter

public class RandomAccessFileAdapter
extends IoAdapter

IO adapter for random access files.


Constructor Summary
RandomAccessFileAdapter()
           
 
Method Summary
 void close()
          implement to close the adapter
 void delete(java.lang.String path)
          deletes the given path from whatever 'file system' is addressed
 boolean exists(java.lang.String path)
          checks whether a file exists
 long getLength()
          implement to return the absolute length of the file
 IoAdapter open(java.lang.String path, boolean lockFile, long initialLength, boolean readOnly)
          implement to open the file
 int read(byte[] bytes, int length)
          implement to read a buffer at the seeked address
 void seek(long pos)
          implement to set the read/write pointer in the file, absolute mode
 void sync()
          implement to flush the file contents to storage
 void write(byte[] buffer, int length)
          implement to write a buffer at the seeked address
 
Methods inherited from class com.db4o.io.IoAdapter
blockCopy, blockSeek, blockSeek, blockSize, blockSize, copy, delegatedIoAdapter, read, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomAccessFileAdapter

public RandomAccessFileAdapter()
Method Detail

close

public void close()
           throws Db4oIOException
Description copied from class: IoAdapter
implement to close the adapter

Specified by:
close in class IoAdapter
Throws:
Db4oIOException

delete

public void delete(java.lang.String path)
Description copied from class: IoAdapter
deletes the given path from whatever 'file system' is addressed

Specified by:
delete in class IoAdapter

exists

public boolean exists(java.lang.String path)
Description copied from class: IoAdapter
checks whether a file exists

Specified by:
exists in class IoAdapter

getLength

public long getLength()
               throws Db4oIOException
Description copied from class: IoAdapter
implement to return the absolute length of the file

Specified by:
getLength in class IoAdapter
Throws:
Db4oIOException

open

public IoAdapter open(java.lang.String path,
                      boolean lockFile,
                      long initialLength,
                      boolean readOnly)
               throws Db4oIOException
Description copied from class: IoAdapter
implement to open the file

Specified by:
open in class IoAdapter
Throws:
Db4oIOException

read

public int read(byte[] bytes,
                int length)
         throws Db4oIOException
Description copied from class: IoAdapter
implement to read a buffer at the seeked address

Specified by:
read in class IoAdapter
Throws:
Db4oIOException

seek

public void seek(long pos)
          throws Db4oIOException
Description copied from class: IoAdapter
implement to set the read/write pointer in the file, absolute mode

Specified by:
seek in class IoAdapter
Throws:
Db4oIOException

sync

public void sync()
          throws Db4oIOException
Description copied from class: IoAdapter
implement to flush the file contents to storage

Specified by:
sync in class IoAdapter
Throws:
Db4oIOException

write

public void write(byte[] buffer,
                  int length)
           throws Db4oIOException
Description copied from class: IoAdapter
implement to write a buffer at the seeked address

Specified by:
write in class IoAdapter
Throws:
Db4oIOException

db4o 7.4

Copyright 2007 db4objects Inc. All rights reserved.