Class FileRandomAccessOutputStream
java.lang.Object
java.io.OutputStream
org.apache.commons.compress.archivers.zip.RandomAccessOutputStream
org.apache.commons.compress.archivers.zip.FileRandomAccessOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
RandomAccessOutputStream
implementation based on a file.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFileRandomAccessOutputStream
(FileChannel channel) FileRandomAccessOutputStream
(Path file, OpenOption... options) -
Method Summary
Modifier and TypeMethodDescription(package private) FileChannel
channel()
void
close()
long
position()
Provides current position in output.void
write
(byte[] b, int off, int len) void
writeFully
(byte[] b, int off, int len, long atPosition) Writes given data to specific position.Methods inherited from class org.apache.commons.compress.archivers.zip.RandomAccessOutputStream
write, writeFully
Methods inherited from class java.io.OutputStream
flush, write
-
Field Details
-
channel
-
position
private long position
-
-
Constructor Details
-
FileRandomAccessOutputStream
FileRandomAccessOutputStream(FileChannel channel) -
FileRandomAccessOutputStream
FileRandomAccessOutputStream(Path file) throws IOException - Throws:
IOException
-
FileRandomAccessOutputStream
FileRandomAccessOutputStream(Path file, OpenOption... options) throws IOException - Throws:
IOException
-
-
Method Details
-
channel
FileChannel channel() -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
position
public long position()Description copied from class:RandomAccessOutputStream
Provides current position in output.- Specified by:
position
in classRandomAccessOutputStream
- Returns:
- current position.
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
writeFully
Description copied from class:RandomAccessOutputStream
Writes given data to specific position.- Specified by:
writeFully
in classRandomAccessOutputStream
- Parameters:
b
- data to writeoff
- offset of the start of data in param blen
- the length of data to writeatPosition
- position in the stream- Throws:
IOException
- if an I/O error occurs.
-