net.lingala.zip4j.io
Class SplitOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by net.lingala.zip4j.io.SplitOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class SplitOutputStream
extends OutputStream


Constructor Summary
SplitOutputStream(File file)
           
SplitOutputStream(File file, long splitLength)
           
SplitOutputStream(String name)
           
SplitOutputStream(String name, long splitLength)
           
 
Method Summary
 boolean checkBuffSizeAndStartNextSplitFile(int bufferSize)
          Checks if the buffer size is sufficient for the current split file.
 void close()
           
 void flush()
           
 int getCurrSplitFileCounter()
           
 long getFilePointer()
           
 long getSplitLength()
           
 boolean isBuffSizeFitForCurrSplitFile(int bufferSize)
          Checks if the given buffer size will be fit in the current split file.
 boolean isSplitZipFile()
           
 void seek(long pos)
           
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SplitOutputStream

public SplitOutputStream(String name)
                  throws FileNotFoundException,
                         ZipException
Throws:
FileNotFoundException
ZipException

SplitOutputStream

public SplitOutputStream(File file)
                  throws FileNotFoundException,
                         ZipException
Throws:
FileNotFoundException
ZipException

SplitOutputStream

public SplitOutputStream(String name,
                         long splitLength)
                  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 class OutputStream
Throws:
IOException

write

public void write(byte[] b)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

checkBuffSizeAndStartNextSplitFile

public boolean checkBuffSizeAndStartNextSplitFile(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

isBuffSizeFitForCurrSplitFile

public boolean isBuffSizeFitForCurrSplitFile(int bufferSize)
                                      throws ZipException
Checks if the given buffer size will be fit in the current split file. If this output stream is a non-split file, then this method always returns true

Parameters:
bufferSize -
Returns:
true if the buffer size is fit in the current split file or else false.
Throws:
ZipException

seek

public void seek(long pos)
          throws IOException
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
Throws:
IOException

getFilePointer

public long getFilePointer()
                    throws IOException
Throws:
IOException

isSplitZipFile

public boolean isSplitZipFile()

getSplitLength

public long getSplitLength()

getCurrSplitFileCounter

public int getCurrSplitFileCounter()


Copyright © 2012. All Rights Reserved.