org.neodatis.odb.impl.core.layers.layer3.buffer
Class MultiBufferedFileIO

java.lang.Object
  extended by org.neodatis.odb.impl.core.layers.layer3.buffer.MultiBufferedIO
      extended by org.neodatis.odb.impl.core.layers.layer3.buffer.MultiBufferedFileIO
All Implemented Interfaces:
IBufferedIO

public class MultiBufferedFileIO
extends MultiBufferedIO

A buffer manager that can manage more than one buffer. Number of buffers can be configured using Configuration.setNbBuffers().

Author:
osmadja

Field Summary
static int nbcalls
           
static int nbdiffcalls
           
 
Fields inherited from class org.neodatis.odb.impl.core.layers.layer3.buffer.MultiBufferedIO
currentPositionWhenUsingBuffer, nbBufferNotOk, nbBufferOk, nbFlushForOverlap, nbSamePositionForRead, nbSamePositionForWrite, nbWrites, numberOfFlush, totalFlushSize, totalWriteSize
 
Constructor Summary
MultiBufferedFileIO(int nbBuffers, java.lang.String name, java.lang.String fileName, boolean canWrite, int bufferSize)
           
 
Method Summary
protected  IO buildFileWriter(boolean canWrite)
           
 void clear()
           
 void closeIO()
           
 boolean delete()
           
 void flushIO()
           
 long getLength()
           
 void goToPosition(long position)
           
 byte internalRead()
           
 long internalRead(byte[] array, int size)
           
 void internalWrite(byte b)
           
 void internalWrite(byte[] bs, int size)
           
 
Methods inherited from class org.neodatis.odb.impl.core.layers.layer3.buffer.MultiBufferedIO
automaticDeleteIsEnabled, close, enableAutomaticDelete, flushAllBuffers, flushBuffer, getCurrentPosition, getIoDeviceLength, getNumberOfFlush, isForTransaction, isUsingbuffer, manageBufferForNewPosition, readByte, readBytes, readBytes, readBytesOld, setCurrentReadPosition, setCurrentWritePosition, setIoDeviceLength, setUseBuffer, toString, writeByte, writeBytes, writeBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nbcalls

public static int nbcalls

nbdiffcalls

public static int nbdiffcalls
Constructor Detail

MultiBufferedFileIO

public MultiBufferedFileIO(int nbBuffers,
                           java.lang.String name,
                           java.lang.String fileName,
                           boolean canWrite,
                           int bufferSize)
Method Detail

buildFileWriter

protected IO buildFileWriter(boolean canWrite)
                      throws java.io.IOException
Throws:
java.io.IOException

goToPosition

public void goToPosition(long position)
Specified by:
goToPosition in interface IBufferedIO
Specified by:
goToPosition in class MultiBufferedIO

getLength

public long getLength()
Specified by:
getLength in interface IBufferedIO
Specified by:
getLength in class MultiBufferedIO

internalWrite

public void internalWrite(byte b)
Specified by:
internalWrite in class MultiBufferedIO

internalWrite

public void internalWrite(byte[] bs,
                          int size)
Specified by:
internalWrite in class MultiBufferedIO

internalRead

public byte internalRead()
Specified by:
internalRead in class MultiBufferedIO

internalRead

public long internalRead(byte[] array,
                         int size)
Specified by:
internalRead in class MultiBufferedIO

closeIO

public void closeIO()
Specified by:
closeIO in class MultiBufferedIO

clear

public void clear()
Specified by:
clear in interface IBufferedIO
Overrides:
clear in class MultiBufferedIO

delete

public boolean delete()

flushIO

public void flushIO()
             throws java.io.IOException
Throws:
java.io.IOException