Package com.twelvemonkeys.io
Class SubStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- com.twelvemonkeys.io.SubStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public final class SubStream extends java.io.FilterInputStreamAnInputStreamreading up to a specified number of bytes from an underlying stream.- Version:
- $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/SubStream.java#2 $
- Author:
- Harald Kuhr
-
-
Constructor Summary
Constructors Constructor Description SubStream(java.io.InputStream pStream, long pLength)Creates aSubStreamof the givenpStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()Marks this stream as closed.voidmark(int pReadLimit)intread()intread(byte[] pBytes)intread(byte[] pBytes, int pOffset, int pLength)voidreset()longskip(long pLength)
-
-
-
Method Detail
-
close
public void close() throws java.io.IOExceptionMarks this stream as closed. This implementation does not close the underlying stream.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.FilterInputStream- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.FilterInputStream- Throws:
java.io.IOException
-
mark
public void mark(int pReadLimit)
- Overrides:
markin classjava.io.FilterInputStream
-
reset
public void reset() throws java.io.IOException- Overrides:
resetin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
read
public final int read(byte[] pBytes) throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
read
public int read(byte[] pBytes, int pOffset, int pLength) throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
skip
public long skip(long pLength) throws java.io.IOException- Overrides:
skipin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
-