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. |
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 OutputStreamIOExceptionpublic void write(byte[] b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void flush()
throws IOException
getFD().sync() on the underlying
RandomAccessFile.flush in interface Flushableflush in class OutputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic long getFilePointer()
throws IOException
IOExceptionpublic void seek(long pos)
throws IOException
IOExceptionCopyright 1999-2012 The Apache Software Foundation. All Rights Reserved.