public class SeekableOutputStream extends OutputStream
OutputStream
which can seek to an arbitrary offset.Constructor and Description |
---|
SeekableOutputStream(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(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.IllegalArgumentException
- if file
is
null
.public void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void flush() throws IOException
getFD().sync()
on the underlying
RandomAccessFile
.flush
in interface Flushable
flush
in class OutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public long getFilePointer() throws IOException
IOException
public void seek(long pos) throws IOException
IOException
Copyright © 2000–2023 Apache Software Foundation. All rights reserved.