com.twelvemonkeys.io
Class SubStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.twelvemonkeys.io.SubStream
- All Implemented Interfaces:
- Closeable
public final class SubStream
- extends FilterInputStream
An InputStream reading 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 |
SubStream(InputStream pStream,
long pLength)
Creates a SubStream of the given pStream. |
|
Method Summary |
int |
available()
|
void |
close()
Marks this stream as closed. |
void |
mark(int pReadLimit)
|
int |
read()
|
int |
read(byte[] pBytes)
|
int |
read(byte[] pBytes,
int pOffset,
int pLength)
|
void |
reset()
|
long |
skip(long pLength)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SubStream
public SubStream(InputStream pStream,
long pLength)
- Creates a
SubStream of the given pStream.
- Parameters:
pStream - the underlying input streampLength - maximum number of bytes to read drom this stream
close
public void close()
throws IOException
- Marks this stream as closed.
This implementation does not close the underlying stream.
- Specified by:
close in interface Closeable- Overrides:
close in class FilterInputStream
- Throws:
IOException
available
public int available()
throws IOException
- Overrides:
available in class FilterInputStream
- Throws:
IOException
mark
public void mark(int pReadLimit)
- Overrides:
mark in class FilterInputStream
reset
public void reset()
throws IOException
- Overrides:
reset in class FilterInputStream
- Throws:
IOException
read
public int read()
throws IOException
- Overrides:
read in class FilterInputStream
- Throws:
IOException
read
public final int read(byte[] pBytes)
throws IOException
- Overrides:
read in class FilterInputStream
- Throws:
IOException
read
public int read(byte[] pBytes,
int pOffset,
int pLength)
throws IOException
- Overrides:
read in class FilterInputStream
- Throws:
IOException
skip
public long skip(long pLength)
throws IOException
- Overrides:
skip in class FilterInputStream
- Throws:
IOException
Copyright © 2015. All Rights Reserved.