public class BufferedRandomAccessFile extends RandomAccessFile
| Constructor and Description |
|---|
BufferedRandomAccessFile(File file,
String mode,
int bufsize) |
BufferedRandomAccessFile(String filename,
String mode,
int bufsize)
Creates a new instance of the BufferedRandomAccessFile.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getFilePointer()
Returns the current position of the pointer in the file.
|
String |
getNextLine()
Returns the next line from the file.
|
int |
read()
Reads one byte form the current position
|
int |
read(byte[] b,
int off,
int len)
Reads the set number of bytes into the passed buffer.
|
void |
seek(long pos)
Moves the internal pointer to the passed (byte) position in the file.
|
close, getChannel, getFD, length, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, setLength, skipBytes, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTFpublic BufferedRandomAccessFile(String filename, String mode, int bufsize) throws IOException
filename - The path of the file to open.mode - Specifies the mode to use ("r", "rw", etc.) See the
BufferedLineReader documentation for more information.bufsize - The buffer size (in bytes) to use.IOExceptionpublic BufferedRandomAccessFile(File file, String mode, int bufsize) throws IOException
IOExceptionpublic final int read()
throws IOException
read in class RandomAccessFileIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class RandomAccessFileb - The buffer to read the bytes into.off - Byte offset within the file to start reading fromlen - Number of bytes to read into the buffer.IOExceptionpublic long getFilePointer()
throws IOException
getFilePointer in class RandomAccessFileIOExceptionpublic void seek(long pos)
throws IOException
seek in class RandomAccessFilepos - The byte position to move to.IOExceptionpublic final String getNextLine() throws IOException
IOExceptionCopyright © 2017. All rights reserved.