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 boolean
checkBufferSizeAndStartNextSplitFile(int bufferSize)
Checks if the buffer size is sufficient for the current split file.void
close()
int
getCurrentSplitFileCounter()
long
getFilePointer()
long
getSplitLength()
boolean
isSplitZipFile()
void
seek(long pos)
int
skipBytes(int n)
void
write(byte[] b)
void
write(byte[] b, int off, int len)
void
write(int b)
-
Methods inherited from class java.io.OutputStream
flush, nullOutputStream
-
-
-
-
Constructor Detail
-
SplitOutputStream
public SplitOutputStream(File file) throws FileNotFoundException, ZipException
- Throws:
FileNotFoundException
ZipException
-
SplitOutputStream
public SplitOutputStream(File file, long splitLength) throws FileNotFoundException, ZipException
- Throws:
FileNotFoundException
ZipException
-
-
Method Detail
-
write
public void write(int b) throws IOException
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
public void write(byte[] b) throws IOException
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
checkBufferSizeAndStartNextSplitFile
public boolean checkBufferSizeAndStartNextSplitFile(int bufferSize) throws ZipException
Checks 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
getFilePointer
public long getFilePointer() throws IOException
- Specified by:
getFilePointer
in interfaceOutputStreamWithSplitZipSupport
- Throws:
IOException
-
isSplitZipFile
public boolean isSplitZipFile()
-
getSplitLength
public long getSplitLength()
-
getCurrentSplitFileCounter
public int getCurrentSplitFileCounter()
- Specified by:
getCurrentSplitFileCounter
in interfaceOutputStreamWithSplitZipSupport
-
-