public class EOFOnMatchInputStream extends PushbackInputStream implements ReadCounter
buf, posin| Constructor and Description |
|---|
EOFOnMatchInputStream(InputStream in,
byte[] match)Non-counter mode. |
EOFOnMatchInputStream(InputStream in,
ReadCounter ctr,
byte[] match)Counter mode. |
| Modifier and Type | Method and Description |
|---|---|
long | getRead()If constructed with a counter, returns the count
(not necessarily starting at 0) minus the buffered/matched count. |
int | read() |
int | read(byte[] buf,
int off,
int len)Read bytes into a buffer. |
long | skip(long n)Skip bytes in the stream. |
boolean | wasFound() |
available, close, mark, markSupported, reset, unread, unread, unreadreadpublic EOFOnMatchInputStream(InputStream in, byte[] match)
match - will be copiedpublic EOFOnMatchInputStream(InputStream in, ReadCounter ctr, byte[] match)
match - will be copiedpublic long getRead()
getRead in interface ReadCounterpublic int read()
throws IOExceptionread in class PushbackInputStreamIOExceptionpublic int read(byte[] buf,
int off,
int len)
throws IOExceptionread in class PushbackInputStreambuf - the buffer to read intooff - the start offset in the bufferlen - the maximum number of bytes to readIOException - on I/O errorpublic long skip(long n)
throws IOExceptionskip in class PushbackInputStreamn - the number of bytes to skipIOException - on I/O errorpublic boolean wasFound()