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:
- java.io.Closeable,- java.lang.AutoCloseable
 
 public class LengthLimitedInputStream extends java.io.FilterInputStreamImplements a stream that wraps another input stream, but limits the portion read.
- 
- 
Constructor SummaryConstructors Constructor Description LengthLimitedInputStream(java.io.InputStream in, long offset, long size)Creates a new instance wrapping the given input stream.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()intread()intread(byte[] b, int off, int len)longskip(long n)
 
- 
- 
- 
Constructor Detail- 
LengthLimitedInputStreampublic LengthLimitedInputStream(java.io.InputStream in, long offset, long size) throws java.io.IOExceptionCreates 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:
- java.io.IOException- if there is an error accessing the underlying input stream
 
 
- 
 - 
Method Detail- 
availablepublic int available() throws java.io.IOException- Overrides:
- availablein class- java.io.FilterInputStream
- Throws:
- java.io.IOException
 
 - 
readpublic int read() throws java.io.IOException- Overrides:
- readin class- java.io.FilterInputStream
- Throws:
- java.io.IOException
 
 - 
readpublic int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
- readin class- java.io.FilterInputStream
- Throws:
- java.io.IOException
 
 - 
skippublic long skip(long n) throws java.io.IOException- Overrides:
- skipin class- java.io.FilterInputStream
- Throws:
- java.io.IOException
 
 
- 
 
-