Package org.xnio.streams
Class LimitedInputStream
java.lang.Object
java.io.InputStream
org.xnio.streams.LimitedInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
An input stream which truncates the underlying stream to the given length.
- Author:
- David M. Lloyd
-
Constructor Summary
ConstructorsConstructorDescriptionLimitedInputStream(InputStream delegate, long size) Construct a new instance. -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, read, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
LimitedInputStream
Construct a new instance.- Parameters:
delegate- the delegate streamsize- the maximum size to pass
-
-
Method Details
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
mark
public void mark(int limit) - Overrides:
markin classInputStream
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-