Package gov.nasa.pds.label.io
Class LengthLimitedInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
gov.nasa.pds.label.io.LengthLimitedInputStream
- All Implemented Interfaces:
- Closeable,- AutoCloseable
public class LengthLimitedInputStream extends FilterInputStream
Implements a stream that wraps another input stream, but limits
 the portion read.
- 
Field SummaryFields inherited from class java.io.FilterInputStreamin
- 
Constructor SummaryConstructors Constructor Description LengthLimitedInputStream(InputStream in, long offset, long size)Creates a new instance wrapping the given input stream.
- 
Method SummaryMethods inherited from class java.io.FilterInputStreamclose, mark, markSupported, read, resetMethods inherited from class java.io.InputStreamnullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
- 
Constructor Details- 
LengthLimitedInputStreamCreates a new instance wrapping the given input stream.- Parameters:
- in- the underlying input stream
- offset- the offset from the start of the stream to begin reading
- size- the size of the portion of the data to read
- Throws:
- IOException- if there is an error accessing the underlying input stream
 
 
- 
- 
Method Details- 
available- Overrides:
- availablein class- FilterInputStream
- Throws:
- IOException
 
- 
read- Overrides:
- readin class- FilterInputStream
- Throws:
- IOException
 
- 
read- Overrides:
- readin class- FilterInputStream
- Throws:
- IOException
 
- 
skip- Overrides:
- skipin class- FilterInputStream
- Throws:
- IOException
 
 
-