|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectru.biosoft.util.FileBuffer
ru.biosoft.util.SoftFileBuffer
Optimized by memory size implementation of FileBuffer interface.
SoftFileBuffer provides buffered reading/writing of random access file
Created buffers are based on SoftReference memory allocation.
| Nested Class Summary | |
protected class |
SoftFileBuffer.Buffer
|
| Field Summary | |
protected static org.apache.log4j.Category |
cat
|
protected java.io.RandomAccessFile |
randomFile
|
| Constructor Summary | |
SoftFileBuffer(java.io.File file)
Constructs the RandomAccessBuffer object using specified file . |
|
SoftFileBuffer(java.io.File file,
int sz)
Constructs the RandomAccessBuffer object using specified file and size of buffer. |
|
SoftFileBuffer(java.io.RandomAccessFile rndFile)
Constructs the RandomAccessBuffer object using specified RandomAccessFile. |
|
SoftFileBuffer(java.io.RandomAccessFile rndFile,
int sz)
Constructs the RandomAccessBuffer object. |
|
| Method Summary | |
void |
close()
Closes the buffer. |
protected void |
finalize()
Closes random access file |
byte |
read(int pos)
Reads one byte from requested position. |
void |
write(int pos,
byte bt)
Writes one byte to the requested position in the buffer. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static org.apache.log4j.Category cat
protected java.io.RandomAccessFile randomFile
| Constructor Detail |
public SoftFileBuffer(java.io.RandomAccessFile rndFile,
int sz)
throws java.io.IOException
rndFile - random access filesz - Size of one buffer.
java.io.IOException - any I/O error
public SoftFileBuffer(java.io.RandomAccessFile rndFile)
throws java.io.IOException
rndFile - specified random access file.
java.io.IOException - If any I/O error.
public SoftFileBuffer(java.io.File file,
int sz)
throws java.io.IOException
file - specified file.sz - size of each buffer
java.io.IOException - If any I/O error.
public SoftFileBuffer(java.io.File file)
throws java.io.IOException
file - specified file.
java.io.IOException - If any I/O error.| Method Detail |
public byte read(int pos)
throws java.io.IOException
read in class FileBufferpos - position of requested byte
java.io.IOException - If any I/O errors
public void write(int pos,
byte bt)
throws java.io.IOException
write in class FileBufferpos - position of requested bytebt - stored byte
java.io.IOException - if any I/O errors
protected void finalize()
throws java.lang.Throwable
java.lang.Throwable
public void close()
throws java.io.IOException
close in class FileBufferjava.io.IOException - if an I/O error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||