org.neodatis.odb.core.layers.layer3
Interface IBufferedIO

All Known Implementing Classes:
MultiBufferedFileIO, MultiBufferedIO

public interface IBufferedIO

The interface for buffered IO

Author:
osmadja

Method Summary
 boolean automaticDeleteIsEnabled()
           
 void clear()
           
 void close()
           
 boolean delete()
           
 void enableAutomaticDelete(boolean yesOrNo)
           
 void flushAllBuffers()
           
 void flushBuffer(int bufferIndex)
           
 void flushIO()
           
 long getCurrentPosition()
           
 long getIoDeviceLength()
           
 long getLength()
           
 void goToPosition(long position)
           
 boolean isForTransaction()
           
 boolean isUsingbuffer()
           
 int manageBufferForNewPosition(long newPosition, int readOrWrite, int size)
          Checks if the new position is in the buffer, if not, flushes the buffer and rebuilds it to the correct position
 byte readByte()
           
 byte[] readBytes(int size)
           
 byte[] readBytesOld(int size)
           
 void setCurrentReadPosition(long currentPosition)
           
 void setCurrentWritePosition(long currentPosition)
           
 void setIoDeviceLength(long ioDeviceLength)
           
 void setUseBuffer(boolean useBuffer)
           
 void writeByte(byte b)
           
 void writeBytes(byte[] bytes)
           
 

Method Detail

goToPosition

void goToPosition(long position)

getLength

long getLength()

manageBufferForNewPosition

int manageBufferForNewPosition(long newPosition,
                               int readOrWrite,
                               int size)
Checks if the new position is in the buffer, if not, flushes the buffer and rebuilds it to the correct position

Parameters:
newPosition -
readOrWrite -
size - Size if the data that must be stored
Returns:
The index of the buffer where that contains the position

isUsingbuffer

boolean isUsingbuffer()

setUseBuffer

void setUseBuffer(boolean useBuffer)

getCurrentPosition

long getCurrentPosition()

setCurrentWritePosition

void setCurrentWritePosition(long currentPosition)

setCurrentReadPosition

void setCurrentReadPosition(long currentPosition)

writeByte

void writeByte(byte b)

readBytesOld

byte[] readBytesOld(int size)

readBytes

byte[] readBytes(int size)

readByte

byte readByte()

writeBytes

void writeBytes(byte[] bytes)

flushBuffer

void flushBuffer(int bufferIndex)

flushAllBuffers

void flushAllBuffers()

flushIO

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

getIoDeviceLength

long getIoDeviceLength()

setIoDeviceLength

void setIoDeviceLength(long ioDeviceLength)

close

void close()

clear

void clear()

delete

boolean delete()

isForTransaction

boolean isForTransaction()

enableAutomaticDelete

void enableAutomaticDelete(boolean yesOrNo)

automaticDeleteIsEnabled

boolean automaticDeleteIsEnabled()