Public class RandomAccessFile extends Object implements DataInput, DataOutput, Closeable
Constructors | Description |
---|---|
RandomAccessFile(File file, String mode) | The function of this constructor is to create a random access file with represented file to read or write from. |
Method | Description |
---|---|
void close () | The function of this method is to close the present stream and associated to input stream systems resources are released without any impact. |
void read fully(byte[] b) | The function of this method is to read the bytes from the input stream and store in array bytes starting from file pointer. |
void write (byte b) | The function of this method is to write the represented byte into file from current file pointer. |
void write (byte[] b, int off, int n) | By using this method it writes the data up to 'n' bytes from the array of bytes starting at current file pointer to file. |
FileChannel getChannel () | The function of this method is to return the file channel object associated with the current file. |
long getFilePointer() | The function of this method is to represent the present offset to the file. |
void writeBoolean(boolean b) | The function of this method is to write the boolean value to the file. |
void seek (long pos) | The function of this method is to represent the file pointer offset that where have to start. |