class BufferedRandomAccessFile
extends RandomAccessFileOrArray
| Modifier and Type | Field and Description |
|---|---|
(package private) RandomAccessFile |
baseFile |
(package private) byte[] |
buffer |
(package private) int |
BUFFER_SIZE |
(package private) int |
bufferFilePointer |
(package private) int |
bufferLength |
(package private) int |
bufferPos |
(package private) String |
filename |
(package private) boolean |
havePrevByte |
(package private) byte |
prevByte |
(package private) int |
startOffset |
| Constructor and Description |
|---|
BufferedRandomAccessFile(String filename) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
private void |
fillBuffer()
Fill our buffer with data at the current file pointer.
|
int |
getFilePointer() |
ByteBuffer |
getNioByteBuffer() |
int |
getStartOffset() |
protected void |
insureOpen() |
boolean |
isOpen() |
int |
length() |
void |
pushBack(byte b) |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
reOpen() |
void |
seek(int pos) |
void |
seek(long pos) |
void |
setStartOffset(int off) |
int |
skipBytes(int n) |
InputStreamToArray, read, readBoolean, readByte, readChar, readCharLE, readDouble, readDoubleLE, readFloat, readFloatLE, readFully, readFully, readInt, readIntLE, readLine, readLong, readLongLE, readShort, readShortLE, readUnsignedByte, readUnsignedInt, readUnsignedIntLE, readUnsignedShort, readUnsignedShortLE, readUTF, skipRandomAccessFile baseFile
byte prevByte
boolean havePrevByte
final int BUFFER_SIZE
byte[] buffer
int startOffset
int bufferLength
int bufferPos
int bufferFilePointer
String filename
public BufferedRandomAccessFile(String filename)
throws IOException
IOExceptionpublic void pushBack(byte b)
pushBack in class RandomAccessFileOrArrayprivate void fillBuffer()
throws IOException
IOExceptionpublic int read()
throws IOException
read in class RandomAccessFileOrArrayIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class RandomAccessFileOrArrayIOExceptionpublic int skipBytes(int n)
throws IOException
skipBytes in interface DataInputskipBytes in class RandomAccessFileOrArrayIOExceptionpublic void reOpen()
throws IOException
reOpen in class RandomAccessFileOrArrayIOExceptionprotected void insureOpen()
throws IOException
insureOpen in class RandomAccessFileOrArrayIOExceptionpublic boolean isOpen()
isOpen in class RandomAccessFileOrArraypublic void close()
throws IOException
close in class RandomAccessFileOrArrayIOExceptionpublic void setStartOffset(int off)
setStartOffset in class RandomAccessFileOrArraypublic int getStartOffset()
getStartOffset in class RandomAccessFileOrArraypublic int length()
throws IOException
length in class RandomAccessFileOrArrayIOExceptionpublic void seek(int pos)
throws IOException
seek in class RandomAccessFileOrArrayIOExceptionpublic void seek(long pos)
throws IOException
seek in class RandomAccessFileOrArrayIOExceptionpublic int getFilePointer()
throws IOException
getFilePointer in class RandomAccessFileOrArrayIOExceptionpublic ByteBuffer getNioByteBuffer()
throws IOException
getNioByteBuffer in class RandomAccessFileOrArrayIOException