Class RandomAccessOutputStream
java.lang.Object
java.io.OutputStream
org.apache.commons.compress.archivers.zip.RandomAccessOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
- Direct Known Subclasses:
FileRandomAccessOutputStream
,SeekableChannelRandomAccessOutputStream
,ZipSplitOutputStream
Abstraction over OutputStream which also allows random access writes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract long
position()
Provides current position in output.void
write
(int b) (package private) abstract void
writeFully
(byte[] b, int off, int len, long position) Writes given data to specific position.void
writeFully
(byte[] b, long position) Writes given data to specific position.Methods inherited from class java.io.OutputStream
close, flush, write, write
-
Constructor Details
-
RandomAccessOutputStream
RandomAccessOutputStream()
-
-
Method Details
-
position
Provides current position in output.- Returns:
- current position.
- Throws:
IOException
- if an I/O error occurs
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
writeFully
Writes given data to specific position.- Parameters:
b
- data to writeoff
- offset of the start of data in param blen
- the length of data to writeposition
- position in the stream- Throws:
IOException
- if an I/O error occurs.
-
writeFully
Writes given data to specific position.- Parameters:
b
- data to writeposition
- position in the stream- Throws:
IOException
- if an I/O error occurs.
-