org.hudsonci.utils.io
Class OffsetLimitInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.hudsonci.utils.io.OffsetLimitInputStream
All Implemented Interfaces:
Closeable

public class OffsetLimitInputStream
extends InputStream

Provides read-offset and read-limit for an underlying input-stream.

Since:
2.1.0
Author:
Jason Dillon

Field Summary
static int UNLIMITED
           
 
Constructor Summary
OffsetLimitInputStream(InputStream delegate, long offset, long length)
           
 
Method Summary
 int available()
           
 void close()
           
 long getCount()
           
 InputStream getDelegate()
           
 long getLength()
           
 long getOffset()
           
 void mark(int readlimit)
           
 boolean markSupported()
           
 int read()
           
 void reset()
           
 
Methods inherited from class java.io.InputStream
read, read, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNLIMITED

public static final int UNLIMITED
See Also:
Constant Field Values
Constructor Detail

OffsetLimitInputStream

public OffsetLimitInputStream(InputStream delegate,
                              long offset,
                              long length)
                       throws IOException
Throws:
IOException
Method Detail

getDelegate

public InputStream getDelegate()

getOffset

public long getOffset()

getLength

public long getLength()

getCount

public long getCount()

read

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

available

public int available()
              throws IOException
Overrides:
available in class InputStream
Throws:
IOException

close

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

mark

public void mark(int readlimit)
Overrides:
mark in class InputStream

reset

public void reset()
           throws IOException
Overrides:
reset in class InputStream
Throws:
IOException

markSupported

public boolean markSupported()
Overrides:
markSupported in class InputStream


Copyright © 2004-2011 Hudson. All Rights Reserved.