public class SeekableOutputStream
extends java.io.OutputStream
OutputStream which can seek to an arbitrary offset.| Constructor and Description |
|---|
SeekableOutputStream(java.io.RandomAccessFile file)
Constructs a
SeekableOutputStream from a
RandomAccessFile. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush()
Invokes
getFD().sync() on the underlying
RandomAccessFile. |
long |
getFilePointer() |
void |
seek(long pos) |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public SeekableOutputStream(java.io.RandomAccessFile file)
SeekableOutputStream from a
RandomAccessFile. Unless otherwise indicated,
all method invocations are fowarded to the underlying
RandomAccessFile.file - The RandomAccessFile to which calls
will be forwarded.java.lang.IllegalArgumentException - if file is
null.public void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void flush()
throws java.io.IOException
getFD().sync() on the underlying
RandomAccessFile.flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOExceptionpublic long getFilePointer()
throws java.io.IOException
java.io.IOExceptionpublic void seek(long pos)
throws java.io.IOException
java.io.IOExceptionCopyright 1999-2025 The Apache Software Foundation. All Rights Reserved.