Package org.apache.commons.io.output

# Class RandomAccessFileOutputStream

java.lang.Object
java.io.OutputStream
org.apache.commons.io.output.RandomAccessFileOutputStream

All Implemented Interfaces:
  `Closeable`, `Flushable`, `AutoCloseable`

public final class RandomAccessFileOutputStream extends OutputStream
An `OutputStream` that writes to a `RandomAccessFile`.

Since:
  2.18.0

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `RandomAccessFileOutputStream.Builder`
  Builds a new `RandomAccessFileOutputStream`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static RandomAccessFileOutputStream.Builder`
  `builder()`
  Constructs a new `RandomAccessFileOutputStream.Builder`.
  `void`
  `close()`
  `void`
  `flush()`
  `RandomAccessFile`
  `getRandomAccessFile()`
  Gets the underlying random access file.
  `void`
  `write(int b)`

  ### Methods inherited from class java.io.OutputStream

  `write, write`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### builder

    public static RandomAccessFileOutputStream.Builder builder()
    Constructs a new `RandomAccessFileOutputStream.Builder`.
    Returns:
      a new `RandomAccessFileOutputStream.Builder`.

  - ### close

    public void close() throws IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Overrides:
      `close` in class `OutputStream`
    Throws:
      `IOException`

  - ### flush

    public void flush() throws IOException
    Specified by:
      `flush` in interface `Flushable`
    Overrides:
      `flush` in class `OutputStream`
    Throws:
      `IOException`

  - ### getRandomAccessFile

    public RandomAccessFile getRandomAccessFile()
    Gets the underlying random access file.
    Returns:
      the underlying random access file.
    Since:
      2.19.0

  - ### write

    public void write(int b) throws IOException
    Specified by:
      `write` in class `OutputStream`
    Throws:
      `IOException`