public class BufferedRandomAccessFile extends RandomAccessFile
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
BuffSz_ |
| 构造器和说明 |
|---|
BufferedRandomAccessFile(File file,
String mode)
Open a new
BufferedRandomAccessFile on file
in mode mode, which should be "r" for reading only, or
"rw" for reading and writing. |
BufferedRandomAccessFile(File file,
String mode,
int size) |
BufferedRandomAccessFile(String name,
String mode)
Open a new
BufferedRandomAccessFile on the file named
name in mode mode, which should be "r" for
reading only, or "rw" for reading and writing. |
BufferedRandomAccessFile(String name,
String mode,
int size) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
void |
flush()
Flush any bytes in the file's buffer that have not yet been written to
disk.
|
long |
getFilePointer() |
String |
getPath() |
long |
length() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
seek(long pos) |
void |
sync() |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
getChannel, getFD, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, setLength, skipBytes, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTFpublic static final int BuffSz_
public BufferedRandomAccessFile(File file, String mode) throws IOException
BufferedRandomAccessFile on file
in mode mode, which should be "r" for reading only, or
"rw" for reading and writing.IOExceptionpublic BufferedRandomAccessFile(File file, String mode, int size) throws IOException
IOExceptionpublic BufferedRandomAccessFile(String name, String mode) throws IOException
BufferedRandomAccessFile on the file named
name in mode mode, which should be "r" for
reading only, or "rw" for reading and writing.IOExceptionpublic BufferedRandomAccessFile(String name, String mode, int size) throws FileNotFoundException
public String getPath()
public void sync()
throws IOException
IOExceptionpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 RandomAccessFileIOExceptionpublic void flush()
throws IOException
IOExceptionpublic void seek(long pos)
throws IOException
seek 在类中 RandomAccessFileIOExceptionpublic long getFilePointer()
getFilePointer 在类中 RandomAccessFilepublic long length()
throws IOException
length 在类中 RandomAccessFileIOExceptionpublic int read()
throws IOException
read 在类中 RandomAccessFileIOExceptionpublic int read(byte[] b)
throws IOException
read 在类中 RandomAccessFileIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read 在类中 RandomAccessFileIOExceptionpublic void write(int b)
throws IOException
write 在接口中 DataOutputwrite 在类中 RandomAccessFileIOExceptionpublic void write(byte[] b)
throws IOException
write 在接口中 DataOutputwrite 在类中 RandomAccessFileIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write 在接口中 DataOutputwrite 在类中 RandomAccessFileIOExceptionCopyright © 2021. All rights reserved.