org.sblim.cimclient.internal.http.io
Class BoundedInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.sblim.cimclient.internal.http.io.BoundedInputStream
- All Implemented Interfaces:
- Closeable
public class BoundedInputStream
- extends FilterInputStream
Class BoundedInputStream implements an input stream with a maximum byte
count.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BoundedInputStream
public BoundedInputStream(InputStream pStream)
- Ctor. Creates the stream with unlimited length.
- Parameters:
pStream
- The stream this one is build upon
BoundedInputStream
public BoundedInputStream(InputStream pStream,
long pMaximumLength)
- Ctor.
- Parameters:
pStream
- The stream this one is build uponpMaximumLength
- The maximum number of bytes that can be read from this stream.
A value of -1 represents unlimited mode.
read
public int read()
throws IOException
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
read
public int read(byte[] buf)
throws IOException
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
read
public int read(byte[] buf,
int off,
int len)
throws IOException
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
skip
public long skip(long len)
throws IOException
- Overrides:
skip
in class FilterInputStream
- Throws:
IOException
available
public int available()
throws IOException
- Overrides:
available
in class FilterInputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class FilterInputStream
- Throws:
IOException
Copyright © 2005, 2013 IBM Corporation. All Rights Reserved.