public class RandomAccessFile extends Object implements DataOutput, DataInput
Constructor and Description |
---|
RandomAccessFile(File file,
String mode) |
RandomAccessFile(String name,
String mode) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
finalize()
The default finalizer does nothing.
|
FileDescriptor |
getFD() |
long |
getFilePointer() |
long |
length() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
boolean |
readBoolean() |
byte |
readByte() |
char |
readChar() |
double |
readDouble() |
float |
readFloat() |
void |
readFully(byte[] b) |
void |
readFully(byte[] b,
int off,
int len) |
int |
readInt() |
String |
readLine() |
long |
readLong() |
short |
readShort() |
int |
readUnsignedByte() |
int |
readUnsignedShort() |
String |
readUTF() |
void |
seek(long pos) |
void |
setLength(long NewLength) |
int |
skipBytes(int n) |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
void |
writeBoolean(boolean v) |
void |
writeByte(int v) |
void |
writeBytes(String s) |
void |
writeChar(int v) |
void |
writeChars(String s) |
void |
writeDouble(double v) |
void |
writeFloat(float v) |
void |
writeInt(int v) |
void |
writeLong(long v) |
void |
writeShort(int v) |
void |
writeUTF(String str) |
public RandomAccessFile(String name, String mode) throws FileNotFoundException
FileNotFoundException
public RandomAccessFile(File file, String mode) throws FileNotFoundException
FileNotFoundException
public final FileDescriptor getFD() throws IOException
IOException
public int read() throws IOException
IOException
public int read(byte[] b, int off, int len) throws IOException, NullPointerException, ArrayIndexOutOfBoundsException
public int read(byte[] b) throws IOException, NullPointerException
IOException
NullPointerException
public final void readFully(byte[] b) throws IOException, NullPointerException, ArrayIndexOutOfBoundsException, EOFException
readFully
in interface DataInput
IOException
NullPointerException
ArrayIndexOutOfBoundsException
EOFException
public final void readFully(byte[] b, int off, int len) throws IOException, NullPointerException, EOFException
readFully
in interface DataInput
IOException
NullPointerException
EOFException
public int skipBytes(int n) throws IOException
skipBytes
in interface DataInput
IOException
public void write(int b) throws IOException
write
in interface DataOutput
IOException
public void write(byte[] b) throws IOException, NullPointerException
write
in interface DataOutput
IOException
NullPointerException
public void write(byte[] b, int off, int len) throws IOException, NullPointerException, ArrayIndexOutOfBoundsException
write
in interface DataOutput
IOException
NullPointerException
ArrayIndexOutOfBoundsException
public long getFilePointer() throws IOException
IOException
public void seek(long pos) throws IOException
IOException
public long length() throws IOException
IOException
public void setLength(long NewLength) throws IOException
IOException
public void close() throws IOException
IOException
public final boolean readBoolean() throws IOException
readBoolean
in interface DataInput
IOException
public final byte readByte() throws IOException
readByte
in interface DataInput
IOException
public final int readUnsignedByte() throws IOException
readUnsignedByte
in interface DataInput
IOException
public final short readShort() throws IOException
readShort
in interface DataInput
IOException
public final int readUnsignedShort() throws IOException
readUnsignedShort
in interface DataInput
IOException
public final char readChar() throws IOException
readChar
in interface DataInput
IOException
public final int readInt() throws IOException
readInt
in interface DataInput
IOException
public final long readLong() throws IOException
readLong
in interface DataInput
IOException
public final float readFloat() throws IOException
readFloat
in interface DataInput
IOException
public final double readDouble() throws IOException
readDouble
in interface DataInput
IOException
public final void writeBoolean(boolean v) throws IOException
writeBoolean
in interface DataOutput
IOException
public final void writeByte(int v) throws IOException
writeByte
in interface DataOutput
IOException
public final void writeShort(int v) throws IOException
writeShort
in interface DataOutput
IOException
public final void writeChar(int v) throws IOException
writeChar
in interface DataOutput
IOException
public final void writeInt(int v) throws IOException
writeInt
in interface DataOutput
IOException
public final void writeLong(long v) throws IOException
writeLong
in interface DataOutput
IOException
public final void writeFloat(float v) throws IOException
writeFloat
in interface DataOutput
IOException
public final void writeDouble(double v) throws IOException
writeDouble
in interface DataOutput
IOException
public final String readLine() throws IOException
readLine
in interface DataInput
IOException
public final String readUTF() throws IOException
readUTF
in interface DataInput
IOException
public final void writeBytes(String s) throws IOException
writeBytes
in interface DataOutput
IOException
public final void writeChars(String s) throws IOException
writeChars
in interface DataOutput
IOException
public final void writeUTF(String str) throws IOException
writeUTF
in interface DataOutput
IOException