|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.objectwave.utility.BufferedRandomAccessFile
Extension fo the RandomAccessFile to use currBuf.bytesfered I/O as much as
possible. Usable with the com.objectwave.persist.FileBroker .
Publically identical to java.io.RandomAccessFile , except for
the constuctor and flush() .
Note: This class is not threadsafe.
RandomAccessFile| Nested Class Summary | |
protected class |
BufferedRandomAccessFile.FileBufferStruct
|
static class |
BufferedRandomAccessFile.Test
Description of the Class |
| Field Summary | |
protected BufferedRandomAccessFile.FileBufferStruct |
altBuf
|
protected BufferedRandomAccessFile.FileBufferStruct |
currBuf
|
| Constructor Summary | |
protected |
BufferedRandomAccessFile(java.io.File file,
java.lang.String mode)
Constructor for the BufferedRandomAccessFile object |
|
BufferedRandomAccessFile(java.io.File file,
java.lang.String mode,
int bufferSize)
Constructor for the BufferedRandomAccessFile object |
| Method Summary | |
void |
close()
Description of the Method |
protected void |
commitBuffer()
If modified, write buffered bytes to the delegate file |
protected void |
fillBuffer()
Description of the Method |
void |
flush()
Description of the Method |
java.io.FileDescriptor |
getFD()
Gets the FD attribute of the BufferedRandomAccessFile object |
long |
getFilePointer()
Gets the FilePointer attribute of the BufferedRandomAccessFile object |
java.io.Reader |
getReader()
Gets the Reader attribute of the BufferedRandomAccessFile object |
java.io.Writer |
getWriter()
Gets the Writer attribute of the BufferedRandomAccessFile object |
long |
length()
Description of the Method |
int |
read()
Description of the Method |
int |
read(byte[] b)
Description of the Method |
int |
read(byte[] b,
int pos,
int len)
Description of the Method |
boolean |
readBoolean()
Description of the Method |
byte |
readByte()
Description of the Method |
char |
readChar()
Description of the Method |
double |
readDouble()
Description of the Method |
float |
readFloat()
Description of the Method |
void |
readFully(byte[] b)
Description of the Method |
void |
readFully(byte[] b,
int pos,
int len)
Description of the Method |
int |
readInt()
Description of the Method |
java.lang.String |
readLine()
Description of the Method |
long |
readLong()
Description of the Method |
short |
readShort()
Description of the Method |
int |
readUnsignedByte()
Description of the Method |
int |
readUnsignedShort()
Description of the Method |
java.lang.String |
readUTF()
Description of the Method |
void |
seek(long pos)
Description of the Method |
void |
setLength(long newLength)
Sets the Length attribute of the BufferedRandomAccessFile object |
int |
skipBytes(int n)
Description of the Method |
long |
skipBytes(long n)
Description of the Method |
protected int |
syncBuffer(long new_FP)
Save any changes and re-read the currBuf.bytes from the given position. |
void |
write(byte[] b)
Description of the Method |
void |
write(byte[] b,
int pos,
int len)
Description of the Method |
void |
write(int b)
Description of the Method |
void |
writeBoolean(boolean b)
Description of the Method |
void |
writeByte(int b)
Description of the Method |
void |
writeBytes(java.lang.String s)
Description of the Method |
void |
writeChar(int ch)
Description of the Method |
void |
writeChars(java.lang.String s)
Description of the Method |
void |
writeDouble(double f)
Description of the Method |
void |
writeFloat(float f)
Description of the Method |
void |
writeInt(int i)
Description of the Method |
void |
writeLong(long l)
Description of the Method |
void |
writeShort(int s)
Description of the Method |
void |
writeUTF(java.lang.String str)
Description of the Method |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected BufferedRandomAccessFile.FileBufferStruct currBuf
protected BufferedRandomAccessFile.FileBufferStruct altBuf
| Constructor Detail |
public BufferedRandomAccessFile(java.io.File file,
java.lang.String mode,
int bufferSize)
throws java.io.IOException
file - Description of Parametermode - Description of ParameterbufferSize - Description of Parameter
java.io.IOException - Description of Exception
protected BufferedRandomAccessFile(java.io.File file,
java.lang.String mode)
throws java.io.IOException
file - Description of Parametermode - Description of Parameter
java.io.IOException - Description of Exception| Method Detail |
public void setLength(long newLength)
throws java.io.IOException
newLength - The new Length value
java.io.IOException - Description of Exceptionpublic java.io.Reader getReader()
public java.io.Writer getWriter()
public java.io.FileDescriptor getFD()
throws java.io.IOException
java.io.IOException - Description of Exceptionpublic long getFilePointer()
public boolean readBoolean()
throws java.io.IOException
readBoolean in interface java.io.DataInputjava.io.IOException - Description of Exception
public int readUnsignedByte()
throws java.io.IOException
readUnsignedByte in interface java.io.DataInputjava.io.IOException - Description of Exception
public byte readByte()
throws java.io.IOException
readByte in interface java.io.DataInputjava.io.IOException - Description of Exception
public short readShort()
throws java.io.IOException
readShort in interface java.io.DataInputjava.io.IOException - Description of Exception
public int readUnsignedShort()
throws java.io.IOException
readUnsignedShort in interface java.io.DataInputjava.io.IOException - Description of Exception
public char readChar()
throws java.io.IOException
readChar in interface java.io.DataInputjava.io.IOException - Description of Exception
public int readInt()
throws java.io.IOException
readInt in interface java.io.DataInputjava.io.IOException - Description of Exception
public long readLong()
throws java.io.IOException
readLong in interface java.io.DataInputjava.io.IOException - Description of Exception
public float readFloat()
throws java.io.IOException
readFloat in interface java.io.DataInputjava.io.IOException - Description of Exception
public double readDouble()
throws java.io.IOException
readDouble in interface java.io.DataInputjava.io.IOException - Description of Exception
public java.lang.String readLine()
throws java.io.IOException
readLine in interface java.io.DataInputjava.io.IOException - Description of Exception
public java.lang.String readUTF()
throws java.io.IOException
readUTF in interface java.io.DataInputjava.io.IOException - Description of Exception
public void writeBoolean(boolean b)
throws java.io.IOException
writeBoolean in interface java.io.DataOutputb - Description of Parameter
java.io.IOException - Description of Exception
public void writeByte(int b)
throws java.io.IOException
writeByte in interface java.io.DataOutputb - Description of Parameter
java.io.IOException - Description of Exception
public void writeShort(int s)
throws java.io.IOException
writeShort in interface java.io.DataOutputs - Description of Parameter
java.io.IOException - Description of Exception
public void writeChar(int ch)
throws java.io.IOException
writeChar in interface java.io.DataOutputch - Description of Parameter
java.io.IOException - Description of Exception
public void writeInt(int i)
throws java.io.IOException
writeInt in interface java.io.DataOutputi - Description of Parameter
java.io.IOException - Description of Exception
public void writeLong(long l)
throws java.io.IOException
writeLong in interface java.io.DataOutputl - Description of Parameter
java.io.IOException - Description of Exception
public void writeFloat(float f)
throws java.io.IOException
writeFloat in interface java.io.DataOutputf - Description of Parameter
java.io.IOException - Description of Exception
public void writeDouble(double f)
throws java.io.IOException
writeDouble in interface java.io.DataOutputf - Description of Parameter
java.io.IOException - Description of Exception
public void writeUTF(java.lang.String str)
throws java.io.IOException
writeUTF in interface java.io.DataOutputstr - Description of Parameter
java.io.IOException - Description of Exception
public void readFully(byte[] b)
throws java.io.IOException
readFully in interface java.io.DataInputb - Description of Parameter
java.io.IOException - Description of Exception
public void readFully(byte[] b,
int pos,
int len)
throws java.io.IOException
readFully in interface java.io.DataInputb - Description of Parameterpos - Description of Parameterlen - Description of Parameter
java.io.IOException - Description of Exception
public void writeBytes(java.lang.String s)
throws java.io.IOException
writeBytes in interface java.io.DataOutputs - Description of Parameter
java.io.IOException - Description of Exception
public void writeChars(java.lang.String s)
throws java.io.IOException
writeChars in interface java.io.DataOutputs - Description of Parameter
java.io.IOException - Description of Exception
public long length()
throws java.io.IOException
java.io.IOException - Description of Exception
public int read()
throws java.io.IOException
java.io.IOException - Description of Exception
public int read(byte[] b)
throws java.io.IOException
b - Description of Parameter
java.io.IOException - Description of Exception
public int read(byte[] b,
int pos,
int len)
throws java.io.IOException
b - Description of Parameterpos - Description of Parameterlen - Description of Parameter
java.io.IOException - Description of Exception
public void seek(long pos)
throws java.io.IOException
pos - Description of Parameter
java.io.IOException - Description of Exception
public int skipBytes(int n)
throws java.io.IOException
skipBytes in interface java.io.DataInputn - Description of Parameter
java.io.IOException - Description of Exception
public long skipBytes(long n)
throws java.io.IOException
n - Description of Parameter
java.io.IOException - Description of Exception
public void write(byte[] b)
throws java.io.IOException
write in interface java.io.DataOutputb - Description of Parameter
java.io.IOException - Description of Exception
public void write(byte[] b,
int pos,
int len)
throws java.io.IOException
write in interface java.io.DataOutputb - Description of Parameterpos - Description of Parameterlen - Description of Parameter
java.io.IOException - Description of Exception
public void write(int b)
throws java.io.IOException
write in interface java.io.DataOutputb - Description of Parameter
java.io.IOException - Description of Exception
public void flush()
throws java.io.IOException
java.io.IOException - Description of Exception
public void close()
throws java.io.IOException
java.io.IOException - Description of Exception
protected int syncBuffer(long new_FP)
throws java.io.IOException
new_FP - Description of Parameter
java.io.IOException - Description of Exception
protected void fillBuffer()
throws java.io.IOException
java.io.IOException - Description of Exception
protected void commitBuffer()
throws java.io.IOException
java.io.IOException - Description of Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||