db4o 7.4

com.db4o.io
Class SymbianIoAdapter

java.lang.Object
  extended by com.db4o.io.IoAdapter
      extended by com.db4o.io.RandomAccessFileAdapter
          extended by com.db4o.io.SymbianIoAdapter

public class SymbianIoAdapter
extends RandomAccessFileAdapter

Workaround for two I/O bugs in Symbian JDK versions:
- seek() cannot move beyond the current file length.
Fix: Write padding bytes up to the seek target if necessary
- Under certain (rare) conditions, calls to RAF.length() seems to garble up following reads.
Fix: Use a second RAF handle to the file for length() calls only.

Usage:
Db4o.configure().io(new com.db4o.io.SymbianIoAdapter())

TODO:
- BasicClusterTest C/S fails (in AllTests context only)


Constructor Summary
SymbianIoAdapter()
           
 
Method Summary
 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 write(byte[] buffer, int length)
          implement to write a buffer at the seeked address
 
Methods inherited from class com.db4o.io.RandomAccessFileAdapter
close, delete, exists, sync
 
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

SymbianIoAdapter

public SymbianIoAdapter()
Method Detail

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

Overrides:
open in class RandomAccessFileAdapter
Throws:
Db4oIOException

getLength

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

Overrides:
getLength in class RandomAccessFileAdapter
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

Overrides:
read in class RandomAccessFileAdapter
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

Overrides:
write in class RandomAccessFileAdapter
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

Overrides:
seek in class RandomAccessFileAdapter
Throws:
Db4oIOException

db4o 7.4

Copyright 2007 db4objects Inc. All rights reserved.