|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream java.io.FilterInputStream edu.rice.cs.cunit.util.PositionInputStream
public class PositionInputStream
A stream that makes the position in the stream available.
Field Summary | |
---|---|
private long |
mark
Mark. |
private long |
pos
Position. |
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
PositionInputStream(java.io.InputStream in)
Create a new PositionInputStream based on the stream given. |
Method Summary | |
---|---|
long |
getPosition()
Get the stream position. |
void |
mark(int readlimit)
|
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
void |
reset()
|
long |
skip(long skip)
|
Methods inherited from class java.io.FilterInputStream |
---|
available, close, markSupported, read |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private long pos
private long mark
Constructor Detail |
---|
public PositionInputStream(java.io.InputStream in)
in
- input streamMethod Detail |
---|
public long getPosition()
Get the stream position.
Eventually, the position will roll over to a negative number. Reading 1 Tb per second, this would occur after approximately three months. Applications should account for this possibility in their design.
getPosition
in interface ProvidesInputStreamPosition
public int read() throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public long skip(long skip) throws java.io.IOException
skip
in class java.io.FilterInputStream
java.io.IOException
public void mark(int readlimit)
mark
in class java.io.FilterInputStream
public void reset() throws java.io.IOException
reset
in class java.io.FilterInputStream
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |