public interface IRandomAccessFile extends java.io.DataInput, java.io.DataOutput, java.io.Closeable, IInputStream, IOutputStream
RandomAccessFile
.Modifier and Type | Method and Description |
---|---|
java.nio.ByteOrder |
getByteOrder()
Gets the byte-order (endiness) of the random access file.
|
long |
getFilePointer()
Returns the current offset in this file.
|
long |
length()
Returns the length of this file.
|
boolean |
readBoolean() |
byte |
readByte() |
char |
readChar() |
double |
readDouble() |
float |
readFloat() |
void |
readFully(byte[] b) |
void |
readFully(byte[] b,
int off,
int len) |
int |
readInt() |
java.lang.String |
readLine() |
long |
readLong() |
short |
readShort() |
int |
readUnsignedByte() |
int |
readUnsignedShort() |
java.lang.String |
readUTF() |
void |
seek(long pos)
Sets the file-pointer offset, measured from the beginning of this file, at which the next
read or write occurs.
|
void |
setByteOrder(java.nio.ByteOrder byteOrder)
Sets the byte-order (endiness) of the random access file.
|
void |
setLength(long newLength)
Sets the length of this file.
|
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(java.lang.String s) |
void |
writeChar(int v) |
void |
writeChars(java.lang.String s) |
void |
writeDouble(double v) |
void |
writeFloat(float v) |
void |
writeInt(int v) |
void |
writeLong(long v) |
void |
writeShort(int v) |
void |
writeUTF(java.lang.String str) |
available, close, mark, markSupported, read, read, read, reset, skip
close, flush, synchronize
java.nio.ByteOrder getByteOrder()
void setByteOrder(java.nio.ByteOrder byteOrder)
long getFilePointer() throws IOExceptionUnchecked
IOExceptionUnchecked
- if an I/O error occurs.void seek(long pos) throws IOExceptionUnchecked
pos
- the offset position, measured in bytes from the beginning of the file, at which to
set the file pointer.IOExceptionUnchecked
- if pos
is less than 0
or if an I/O
error occurs.long length() throws IOExceptionUnchecked
IOExceptionUnchecked
- if an I/O error occurs.void setLength(long newLength) throws IOExceptionUnchecked
If the present length of the file as returned by the length
method is greater
than the newLength
argument then the file will be truncated. In this case, if
the file offset as returned by the getFilePointer
method is greater than
newLength
then after this method returns the offset will be equal to
newLength
.
If the present length of the file as returned by the length
method is smaller
than the newLength
argument then the file will be extended. In this case, the
contents of the extended portion of the file are not defined.
newLength
- The desired length of the fileIOExceptionUnchecked
- If an I/O error occursvoid readFully(byte[] b) throws IOExceptionUnchecked
readFully
in interface java.io.DataInput
IOExceptionUnchecked
DataInput.readFully(byte[])
void readFully(byte[] b, int off, int len) throws IOExceptionUnchecked
readFully
in interface java.io.DataInput
IOExceptionUnchecked
DataInput.readFully(byte[], int, int)
int skipBytes(int n) throws IOExceptionUnchecked
skipBytes
in interface java.io.DataInput
IOExceptionUnchecked
DataInput.skipBytes(int)
boolean readBoolean() throws IOExceptionUnchecked
readBoolean
in interface java.io.DataInput
IOExceptionUnchecked
DataInput.readBoolean()
byte readByte() throws IOExceptionUnchecked
readByte
in interface java.io.DataInput
IOExceptionUnchecked
DataInput.readByte()
int readUnsignedByte() throws IOExceptionUnchecked
readUnsignedByte
in interface java.io.DataInput
IOExceptionUnchecked
DataInput.readUnsignedByte()
short readShort() throws IOExceptionUnchecked
readShort
in interface java.io.DataInput
IOExceptionUnchecked
DataInput.readShort()
int readUnsignedShort() throws IOExceptionUnchecked
readUnsignedShort
in interface java.io.DataInput
IOExceptionUnchecked
DataInput.readUnsignedShort()
char readChar() throws IOExceptionUnchecked
readChar
in interface java.io.DataInput
IOExceptionUnchecked
DataInput.readChar()
int readInt() throws IOExceptionUnchecked
readInt
in interface java.io.DataInput
IOExceptionUnchecked
DataInput.readInt()
long readLong() throws IOExceptionUnchecked
readLong
in interface java.io.DataInput
IOExceptionUnchecked
DataInput.readLong()
float readFloat() throws IOExceptionUnchecked
readFloat
in interface java.io.DataInput
IOExceptionUnchecked
DataInput.readFloat()
double readDouble() throws IOExceptionUnchecked
readDouble
in interface java.io.DataInput
IOExceptionUnchecked
DataInput.readDouble()
java.lang.String readLine() throws IOExceptionUnchecked
readLine
in interface java.io.DataInput
IOExceptionUnchecked
DataInput.readLine()
java.lang.String readUTF() throws IOExceptionUnchecked
readUTF
in interface java.io.DataInput
IOExceptionUnchecked
DataInput.readUTF()
void write(int b) throws IOExceptionUnchecked
write
in interface java.io.DataOutput
write
in interface IOutputStream
IOExceptionUnchecked
DataOutput.write(int)
void write(byte[] b) throws IOExceptionUnchecked
write
in interface java.io.DataOutput
write
in interface IOutputStream
IOExceptionUnchecked
DataOutput.write(byte[])
void write(byte[] b, int off, int len) throws IOExceptionUnchecked
write
in interface java.io.DataOutput
write
in interface IOutputStream
IOExceptionUnchecked
DataOutput.write(byte[], int, int)
void writeBoolean(boolean v) throws IOExceptionUnchecked
writeBoolean
in interface java.io.DataOutput
IOExceptionUnchecked
DataOutput.writeBoolean(boolean)
void writeByte(int v) throws IOExceptionUnchecked
writeByte
in interface java.io.DataOutput
IOExceptionUnchecked
DataOutput.writeByte(int)
void writeShort(int v) throws IOExceptionUnchecked
writeShort
in interface java.io.DataOutput
IOExceptionUnchecked
DataOutput.writeShort(int)
void writeChar(int v) throws IOExceptionUnchecked
writeChar
in interface java.io.DataOutput
IOExceptionUnchecked
DataOutput.writeChar(int)
void writeInt(int v) throws IOExceptionUnchecked
writeInt
in interface java.io.DataOutput
IOExceptionUnchecked
DataOutput.writeInt(int)
void writeLong(long v) throws IOExceptionUnchecked
writeLong
in interface java.io.DataOutput
IOExceptionUnchecked
DataOutput.writeLong(long)
void writeFloat(float v) throws IOExceptionUnchecked
writeFloat
in interface java.io.DataOutput
IOExceptionUnchecked
DataOutput.writeFloat(float)
void writeDouble(double v) throws IOExceptionUnchecked
writeDouble
in interface java.io.DataOutput
IOExceptionUnchecked
DataOutput.writeDouble(double)
void writeBytes(java.lang.String s) throws IOExceptionUnchecked
writeBytes
in interface java.io.DataOutput
IOExceptionUnchecked
DataOutput.writeBytes(String)
void writeChars(java.lang.String s) throws IOExceptionUnchecked
writeChars
in interface java.io.DataOutput
IOExceptionUnchecked
DataOutput.writeChars(String)
void writeUTF(java.lang.String str) throws IOExceptionUnchecked
writeUTF
in interface java.io.DataOutput
IOExceptionUnchecked
DataOutput.writeUTF(String)