|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream htsjdk.tribble.readers.PositionalBufferedStream
public final class PositionalBufferedStream
A wrapper around an InputStream
which performs it's own buffering, and keeps track of the position.
Constructor Summary | |
---|---|
PositionalBufferedStream(java.io.InputStream is)
|
|
PositionalBufferedStream(java.io.InputStream is,
int bufferSize)
|
Method Summary | |
---|---|
void |
close()
|
long |
getPosition()
The current offset, in bytes, of this stream/writer/file. |
boolean |
isDone()
Is the stream done? Equivalent to ! hasNext() for an iterator? |
static void |
main(java.lang.String[] args)
|
int |
peek()
Return the next byte in the first, without actually reading it from the stream. |
int |
read()
|
int |
read(byte[] bytes)
|
int |
read(byte[] bytes,
int start,
int len)
|
long |
skip(long nBytes)
Skip the next nBytes in the stream. |
Methods inherited from class java.io.InputStream |
---|
available, mark, markSupported, reset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PositionalBufferedStream(java.io.InputStream is)
public PositionalBufferedStream(java.io.InputStream is, int bufferSize)
Method Detail |
---|
public final long getPosition()
LocationAware
getPosition
in interface LocationAware
public final int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public final int read(byte[] bytes, int start, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public final int read(byte[] bytes) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public final boolean isDone() throws java.io.IOException
Positional
isDone
in interface Positional
java.io.IOException
public final int peek() throws java.io.IOException
Positional
peek
in interface Positional
java.io.IOException
public final long skip(long nBytes) throws java.io.IOException
Positional
skip
in interface Positional
skip
in class java.io.InputStream
nBytes
- to skip, must be >= 0
java.io.IOException
public final void close()
close
in interface java.io.Closeable
close
in class java.io.InputStream
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |