@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 cacheFileIOExceptionpublic RandomAccessFileReadWriteCache(IRandomAccessFile randomAccessFile, int pageSize, int maxPage, boolean haveReadCache) throws FileIOException
FileIOExceptionpublic File getFile()
public void openImpl()
throws FileIOException
openImpl in class AbstractRandomAccessFileFileIOExceptionpublic void closeImpl()
throws FileIOException
closeImpl in class AbstractRandomAccessFileFileIOExceptionpublic void flushImpl()
throws FileIOException
flushImpl in class AbstractRandomAccessFileFileIOExceptionpublic void deleteIfExistsImpl()
throws FileIOException
deleteIfExistsImpl in class AbstractRandomAccessFileFileIOExceptionpublic void deleteIfExistsRenamingImpl()
throws FileIOException
deleteIfExistsRenamingImpl in class AbstractRandomAccessFileFileIOExceptionpublic void seekImpl(long positionInFile)
throws FileIOException
seekImpl in class AbstractRandomAccessFileFileIOExceptionprotected long currentPositionInFileImpl()
throws FileIOException
currentPositionInFileImpl in class AbstractRandomAccessFileFileIOExceptionpublic int readImpl(byte[] data)
throws FileIOException
readImpl in class AbstractRandomAccessFileFileIOExceptionprotected int readImpl(byte[] data,
int offset,
int length)
throws FileIOException
readImpl in class AbstractRandomAccessFileFileIOExceptionpublic void writeImpl(byte[] data)
throws FileIOException
writeImpl in class AbstractRandomAccessFileFileIOExceptionpublic void writeImpl(byte[] data,
int length)
throws FileIOException
writeImpl in class AbstractRandomAccessFileFileIOExceptionprotected void writeImpl(byte[] data,
int offset,
int length)
throws FileIOException
writeImpl in class AbstractRandomAccessFileFileIOExceptionpublic long lengthImpl()
throws FileIOException
lengthImpl in class AbstractRandomAccessFileFileIOExceptionpublic void setLengthImpl(long newSize)
throws FileIOException
setLengthImpl in class AbstractRandomAccessFileFileIOExceptionpublic void copy(String fileName) throws FileIOException
IRandomAccessFilefileName - the copy file nameFileIOExceptionpublic 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.