@NotStorableClass public class RandomAccessFileReadWriteCache extends AbstractRandomAccessFile
IRandomAccessFile
delegationIRandomAccessFile
implementationHELPER_FILE_UTIL, logger, opened
Constructor and Description |
---|
RandomAccessFileReadWriteCache(IRandomAccessFile randomAccessFile)
default constructor initialize to 250 pages of 4Kbyte
for test purpose |
RandomAccessFileReadWriteCache(IRandomAccessFile randomAccessFile,
int pageSize,
int maxPage)
construction setting the maximum number of pages for read cache and
setting the page size
|
RandomAccessFileReadWriteCache(IRandomAccessFile randomAccessFile,
int pageSize,
int maxPage,
boolean haveReadCache) |
Modifier and Type | Method and Description |
---|---|
void |
closeImpl() |
void |
copy(String fileName)
make copy of this file in other file
|
protected long |
currentPositionInFileImpl() |
void |
deleteIfExistsImpl() |
void |
deleteIfExistsRenamingImpl() |
boolean |
differs(String fileName,
SortedMap<Integer,Integer> diffMap) |
void |
flushImpl() |
File |
getFile() |
int |
getMaxPage() |
List<Long> |
getPageSet() |
int |
getPageSize() |
long |
lengthImpl() |
void |
openImpl() |
int |
readImpl(byte[] data) |
protected int |
readImpl(byte[] data,
int offset,
int length) |
void |
seekImpl(long positionInFile) |
void |
setLengthImpl(long newSize) |
void |
writeImpl(byte[] data) |
void |
writeImpl(byte[] data,
int length) |
protected void |
writeImpl(byte[] data,
int offset,
int length) |
bitsForValue, close, currentPositionInFile, deleteIfExists, deleteIfExistsRenaming, flush, isClose, isOpen, length, open, read, read, seek, setLength, write, write, write
@Fortest public RandomAccessFileReadWriteCache(IRandomAccessFile randomAccessFile)
file
- the file to use for read/write operationspublic RandomAccessFileReadWriteCache(IRandomAccessFile randomAccessFile, int pageSize, int maxPage) throws FileIOException
file
- the file to use for read/write operationspageSize
- page size ( number of byte ), must be greater or equals to
1024maxPage
- maximum number of page for read cacheFileIOException
public RandomAccessFileReadWriteCache(IRandomAccessFile randomAccessFile, int pageSize, int maxPage, boolean haveReadCache) throws FileIOException
FileIOException
public File getFile()
public void openImpl() throws FileIOException
openImpl
in class AbstractRandomAccessFile
FileIOException
public void closeImpl() throws FileIOException
closeImpl
in class AbstractRandomAccessFile
FileIOException
public void flushImpl() throws FileIOException
flushImpl
in class AbstractRandomAccessFile
FileIOException
public void deleteIfExistsImpl() throws FileIOException
deleteIfExistsImpl
in class AbstractRandomAccessFile
FileIOException
public void deleteIfExistsRenamingImpl() throws FileIOException
deleteIfExistsRenamingImpl
in class AbstractRandomAccessFile
FileIOException
public void seekImpl(long positionInFile) throws FileIOException
seekImpl
in class AbstractRandomAccessFile
FileIOException
protected long currentPositionInFileImpl() throws FileIOException
currentPositionInFileImpl
in class AbstractRandomAccessFile
FileIOException
public int readImpl(byte[] data) throws FileIOException
readImpl
in class AbstractRandomAccessFile
FileIOException
protected int readImpl(byte[] data, int offset, int length) throws FileIOException
readImpl
in class AbstractRandomAccessFile
FileIOException
public void writeImpl(byte[] data) throws FileIOException
writeImpl
in class AbstractRandomAccessFile
FileIOException
public void writeImpl(byte[] data, int length) throws FileIOException
writeImpl
in class AbstractRandomAccessFile
FileIOException
protected void writeImpl(byte[] data, int offset, int length) throws FileIOException
writeImpl
in class AbstractRandomAccessFile
FileIOException
public long lengthImpl() throws FileIOException
lengthImpl
in class AbstractRandomAccessFile
FileIOException
public void setLengthImpl(long newSize) throws FileIOException
setLengthImpl
in class AbstractRandomAccessFile
FileIOException
public void copy(String fileName) throws FileIOException
IRandomAccessFile
fileName
- the copy file nameFileIOException
public boolean differs(String fileName, SortedMap<Integer,Integer> diffMap) throws FileIOException
FileIOException
@Fortest public int getMaxPage()
@Fortest public int getPageSize()
Copyright © 2007-2012 Luc Peuvrier. All Rights Reserved.