com.wizzardo.tools.io
Class BlockInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.wizzardo.tools.io.BlockInputStream
All Implemented Interfaces:
java.io.Closeable

public class BlockInputStream
extends java.io.InputStream


Constructor Summary
BlockInputStream(java.io.InputStream in, byte[] separator)
           
BlockInputStream(java.io.InputStream in, byte[] separator, long limit)
           
BlockInputStream(java.io.InputStream in, byte[] separator, long limit, ProgressListener progressListener)
           
 
Method Summary
 void close()
           
 long getBlockLength()
           
 java.io.InputStream getInputStream()
           
 boolean hasNext()
           
static int isEnding(byte[] b, int length, byte[] endsWith)
           
 void next()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int l)
           
 boolean ready()
           
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockInputStream

public BlockInputStream(java.io.InputStream in,
                        byte[] separator)

BlockInputStream

public BlockInputStream(java.io.InputStream in,
                        byte[] separator,
                        long limit)

BlockInputStream

public BlockInputStream(java.io.InputStream in,
                        byte[] separator,
                        long limit,
                        ProgressListener progressListener)
Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Throws:
java.io.IOException

hasNext

public boolean hasNext()
                throws java.io.IOException
Throws:
java.io.IOException

next

public void next()

read

public int read()
         throws java.io.IOException
Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] b)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int l)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

getBlockLength

public long getBlockLength()

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException

isEnding

public static int isEnding(byte[] b,
                           int length,
                           byte[] endsWith)

ready

public boolean ready()
              throws java.io.IOException
Throws:
java.io.IOException