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.OutputStream
java.io.IOException
public void write(byte[] b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
getFD().sync()
on the underlying
RandomAccessFile
.flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
public long getFilePointer() throws java.io.IOException
java.io.IOException
public void seek(long pos) throws java.io.IOException
java.io.IOException
Copyright © 2022 Apache Software Foundation. All Rights Reserved.