|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream eap.tar.LimitedInputStream
Reads a subset of another stream. All the I/O is redirected to an undelying stream, but this stream will signal EOF after a preset number of bytes have been read.
Constructor Summary | |
LimitedInputStream(InputStream in,
long length)
Create a new stream. |
Method Summary | |
int |
available()
Returns the number of bytes remaining before EOF. |
void |
close()
This method skips to the limit, but does not close the underlying input stream. |
long |
getBytesRead()
Returns the number of bytes which have been read from this stream since it was created. |
long |
getLength()
Returns the total number of bytes which can be read by this stream. |
void |
mark(int read_limit)
sets a mark in the underlying stream. |
boolean |
markSupported()
Returns true if the underlying stream supports marks. |
int |
read()
Read a single byte |
int |
read(byte[] buffer)
Read a block of bytes. |
int |
read(byte[] buffer,
int offset,
int length)
Read a block of bytes. |
void |
reset()
Resets the underlying stream and also adjusts the bytes read accounting. |
long |
skip(long nbytes)
Skip over a number of bytes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LimitedInputStream(InputStream in, long length)
in
- The underlying stream to which I/O will be redirected.length
- The number of bytes which can be read before signaling EOF.Method Detail |
public long getBytesRead()
public long getLength()
public int available()
public void close() throws IOException
IOException
public int read() throws IOException
IOException
public int read(byte[] buffer, int offset, int length) throws IOException
IOException
public int read(byte[] buffer) throws IOException
IOException
public long skip(long nbytes) throws IOException
IOException
public boolean markSupported()
public void mark(int read_limit)
public void reset() throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |