
Package ca.uhn.fhir.util
Class CountingAndLimitingInputStream
- java.lang.Object
-
- java.io.InputStream
-
- ca.uhn.fhir.util.CountingAndLimitingInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class CountingAndLimitingInputStream extends InputStream
-
-
Constructor Summary
Constructors Constructor Description CountingAndLimitingInputStream(InputStream theWrap, int theMaxBytes)
Wraps another input stream, counting the number of bytes read.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
read()
int
read(byte[] theRead)
int
read(byte[] b, int off, int len)
-
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
CountingAndLimitingInputStream
public CountingAndLimitingInputStream(InputStream theWrap, int theMaxBytes)
Wraps another input stream, counting the number of bytes read.- Parameters:
theWrap
- the input stream to be wrapped
-
-
Method Detail
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] theRead) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
-