|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.Reader
com.vwp.io.ByteArrayReader
public class ByteArrayReader
| Constructor Summary | |
|---|---|
ByteArrayReader(byte[] buf)
Create an ByteArrayReader from the specified array of bytes. |
|
ByteArrayReader(byte[] buf,
int offset,
int length)
Create an ByteArrayReader from the specified array of bytes. |
|
| Method Summary | |
|---|---|
void |
close()
Close the stream. |
void |
mark(int readAheadLimit)
Mark the present position in the stream. |
boolean |
markSupported()
Tell whether this stream supports the mark() operation, which it does. |
int |
read()
Read a single byteacter. |
int |
read(byte[] b,
int off,
int len)
Read byteacters into a portion of an array. |
int |
read(char[] b,
int off,
int len)
|
String |
readLine()
Reads all bytes until the next \n |
boolean |
ready()
Tell whether this stream is ready to be read. |
void |
reset()
Reset the stream to the most recent mark, or to the beginning if it has never been marked. |
long |
skip(long n)
Skip bytes. |
| Methods inherited from class java.io.Reader |
|---|
read, read |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ByteArrayReader(byte[] buf)
buf - Input buffer (not copied)
public ByteArrayReader(byte[] buf,
int offset,
int length)
buf - Input buffer (not copied)offset - Offset of the first byte to readlength - Number of bytes to read| Method Detail |
|---|
public int read()
throws IOException
read in class ReaderIOException - If an I/O error occurs
public String readLine()
throws IOException
IOException - If an I/O error occurs
public int read(char[] b,
int off,
int len)
read in class Reader
public int read(byte[] b,
int off,
int len)
throws IOException
b - Destination bufferoff - Offset at which to start storing byteacterslen - Maximum number of byteacters to read
IOException - If an I/O error occurs
public long skip(long n)
throws IOException
skip in class Readern - The number of byteacters to skip
IOException - If an I/O error occurs
public boolean ready()
throws IOException
ready in class ReaderIOException - If an I/O error occurspublic boolean markSupported()
markSupported in class Reader
public void mark(int readAheadLimit)
throws IOException
mark in class ReaderreadAheadLimit - Limit on the number of byteacters that
may be read while still preserving the mark. Because the
stream's input comes from a bytearray, there is no actual
limit and this argument is ignored.
IOException - If an I/O error occurs
public void reset()
throws IOException
reset in class ReaderIOException - If an I/O error occurspublic void close()
close in interface Closeableclose in class Reader
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||