Java.io.RandomAccessFile.write() Method

Description

The java.io.RandomAccessFile.writeBoolean(boolean v) method writes a boolean to the file as a one-byte value. The value true is written out as the value (byte)1; the value false is written out as the value (byte)0. The write starts at the current position of the file pointer.

Declaration

Following is the declaration for java.io.RandomAccessFile.write() method

public final void writeBoolean(boolean v)

Parameters

v -- a boolean value to be written.

Return Value

This method does not return a value.

Exception

IOException -- if an I/O error occurs.

Example

The following example shows the usage of java.io.RandomAccessFile.write() method.