Package org.apache.commons.io.output
Class RandomAccessFileOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.commons.io.output.RandomAccessFileOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public final class RandomAccessFileOutputStream extends java.io.OutputStream
AnOutputStreamthat writes to aRandomAccessFile.- Since:
- 2.18.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRandomAccessFileOutputStream.BuilderBuilds a newRandomAccessFileOutputStream.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RandomAccessFileOutputStream.Builderbuilder()Constructs a newRandomAccessFileOutputStream.Builder.voidclose()voidflush()java.io.RandomAccessFilegetRandomAccessFile()Gets the underlying random access file.voidwrite(int b)
-
-
-
Method Detail
-
builder
public static RandomAccessFileOutputStream.Builder builder()
Constructs a newRandomAccessFileOutputStream.Builder.- Returns:
- a new
RandomAccessFileOutputStream.Builder.
-
close
public void close() throws java.io.IOException
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream- Throws:
java.io.IOException
-
getRandomAccessFile
public java.io.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 java.io.IOException
- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
-