public class BufferedRandomAccessFile extends RandomAccessFile
Constructor and Description |
---|
BufferedRandomAccessFile(File file,
String mode,
int bufsize)
Creates a new instance of the BufferedRandomAccessFile.
|
BufferedRandomAccessFile(String filename,
String mode,
int bufsize)
Creates a new instance of the BufferedRandomAccessFile.
|
Modifier and Type | Method and Description |
---|---|
long |
getFilePointer() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
seek(long pos) |
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, writeUTF
public BufferedRandomAccessFile(String filename, String mode, int bufsize) throws FileNotFoundException
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.FileNotFoundException
- If the mode is "r" but the given string does not denote an
existing regular file, or if the mode begins with "rw" but the given string does not denote
an existing, writable regular file and a new regular file of that name cannot be created, or
if some other error occurs while opening or creating the file.public BufferedRandomAccessFile(File file, String mode, int bufsize) throws FileNotFoundException
file
- 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.FileNotFoundException
- If the mode is "r" but the given file path does not denote an
existing regular file, or if the mode begins with "rw" but the given file path does not denote
an existing, writable regular file and a new regular file of that name cannot be created, or
if some other error occurs while opening or creating the file.public final int read() throws IOException
read
in class RandomAccessFile
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class RandomAccessFile
IOException
public long getFilePointer() throws IOException
getFilePointer
in class RandomAccessFile
IOException
public void seek(long pos) throws IOException
seek
in class RandomAccessFile
IOException
Copyright © 2002–2016 The Apache Software Foundation. All rights reserved.