Class SplitOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- net.lingala.zip4j.io.outputstream.SplitOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,OutputStreamWithSplitZipSupport
public class SplitOutputStream extends OutputStream implements OutputStreamWithSplitZipSupport
-
-
Constructor Summary
Constructors Constructor Description SplitOutputStream(File file)SplitOutputStream(File file, long splitLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckBufferSizeAndStartNextSplitFile(int bufferSize)Checks if the buffer size is sufficient for the current split file.voidclose()intgetCurrentSplitFileCounter()longgetFilePointer()longgetSplitLength()booleanisSplitZipFile()voidseek(long pos)intskipBytes(int n)voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)voidwrite(int b)-
Methods inherited from class java.io.OutputStream
flush, nullOutputStream
-
-
-
-
Constructor Detail
-
SplitOutputStream
public SplitOutputStream(File file) throws FileNotFoundException, ZipException
- Throws:
FileNotFoundExceptionZipException
-
SplitOutputStream
public SplitOutputStream(File file, long splitLength) throws FileNotFoundException, ZipException
- Throws:
FileNotFoundExceptionZipException
-
-
Method Detail
-
write
public void write(int b) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
checkBufferSizeAndStartNextSplitFile
public boolean checkBufferSizeAndStartNextSplitFile(int bufferSize) throws ZipExceptionChecks if the buffer size is sufficient for the current split file. If not a new split file will be started.- Parameters:
bufferSize-- Returns:
- true if a new split file was started else false
- Throws:
ZipException
-
seek
public void seek(long pos) throws IOException- Throws:
IOException
-
skipBytes
public int skipBytes(int n) throws IOException- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
getFilePointer
public long getFilePointer() throws IOException- Specified by:
getFilePointerin interfaceOutputStreamWithSplitZipSupport- Throws:
IOException
-
isSplitZipFile
public boolean isSplitZipFile()
-
getSplitLength
public long getSplitLength()
-
getCurrentSplitFileCounter
public int getCurrentSplitFileCounter()
- Specified by:
getCurrentSplitFileCounterin interfaceOutputStreamWithSplitZipSupport
-
-