Class BoundedInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.sblim.cimclient.internal.http.io.BoundedInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class BoundedInputStream extends java.io.FilterInputStreamClass BoundedInputStream implements an input stream with a maximum byte count.
-
-
Constructor Summary
Constructors Constructor Description BoundedInputStream(java.io.InputStream pStream)Ctor.BoundedInputStream(java.io.InputStream pStream, long pMaximumLength)Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()intread()intread(byte[] buf)intread(byte[] buf, int off, int len)longskip(long len)
-
-
-
Constructor Detail
-
BoundedInputStream
public BoundedInputStream(java.io.InputStream pStream)
Ctor. Creates the stream with unlimited length.- Parameters:
pStream- The stream this one is build upon
-
BoundedInputStream
public BoundedInputStream(java.io.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.
-
-
Method Detail
-
read
public int read() throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
read
public int read(byte[] buf) throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
read
public int read(byte[] buf, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
skip
public long skip(long len) throws java.io.IOException- Overrides:
skipin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.FilterInputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.FilterInputStream- Throws:
java.io.IOException
-
-