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:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
class FileRandomAccessOutputStream extends RandomAccessOutputStream
RandomAccessOutputStreamimplementation based on a file.
-
-
Constructor Summary
Constructors Constructor Description FileRandomAccessOutputStream(java.nio.channels.FileChannel channel)FileRandomAccessOutputStream(java.nio.file.Path file)FileRandomAccessOutputStream(java.nio.file.Path file, java.nio.file.OpenOption... options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.nio.channels.FileChannelchannel()voidclose()longposition()Provides current position in output.voidwrite(byte[] b, int off, int len)voidwriteFully(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
-
-
-
-
Constructor Detail
-
FileRandomAccessOutputStream
FileRandomAccessOutputStream(java.nio.channels.FileChannel channel)
-
FileRandomAccessOutputStream
FileRandomAccessOutputStream(java.nio.file.Path file) throws java.io.IOException- Throws:
java.io.IOException
-
FileRandomAccessOutputStream
FileRandomAccessOutputStream(java.nio.file.Path file, java.nio.file.OpenOption... options) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
channel
java.nio.channels.FileChannel channel()
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream- Throws:
java.io.IOException
-
position
public long position()
Description copied from class:RandomAccessOutputStreamProvides current position in output.- Specified by:
positionin classRandomAccessOutputStream- Returns:
- current position.
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
writeFully
public void writeFully(byte[] b, int off, int len, long atPosition) throws java.io.IOExceptionDescription copied from class:RandomAccessOutputStreamWrites given data to specific position.- Specified by:
writeFullyin 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:
java.io.IOException- if an I/O error occurs.
-
-