public class BufferedReader
extends java.io.Reader
| Modifier and Type | Field and Description |
|---|---|
static int |
EOF |
| Constructor and Description |
|---|
BufferedReader(java.io.Reader reader)
Construct a Buffered reader with a given reader instance, using a default
buffer size.
|
BufferedReader(java.io.Reader reader,
int sz)
Construct a Buffered reader with a given reader instance, and specific
size for buffer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the stream.
|
void |
mark(int readAheadLimit)
Mark the present position in the stream, this implementation currently
does not support marking.
|
boolean |
markSupported()
Tell whether this stream supports the mark() operation, which this
implementation currently does not.
|
int |
peek()
Peek at next single character without advancing the stream (ie.
|
int |
read()
Read a single character.
|
int |
read(char[] cbuf,
int off,
int len)
Read characters into a portion of an array.
|
java.lang.String |
readLine()
Read a line of text.
|
boolean |
ready()
Tell whether this stream is ready to be read.
|
void |
reset()
Reset the stream to the most recent mark.
|
long |
skip(long n)
Skip characters.
|
public static final int EOF
public BufferedReader(java.io.Reader reader)
reader - public BufferedReader(java.io.Reader reader,
int sz)
reader - sz - public void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in class java.io.Readerjava.io.IOException - on error closing the stream.public void mark(int readAheadLimit)
mark in class java.io.ReaderreadAheadLimit - public boolean markSupported()
markSupported in class java.io.Readerpublic int peek()
throws java.io.IOException
java.io.IOException - on error reading from the stream.public int read()
throws java.io.IOException
read in class java.io.Readerjava.io.IOException - on error reading from the stream.public int read(char[] cbuf,
int off,
int len)
throws java.io.IOException
read in class java.io.Readercbuf - the destination buffer to read characters into.off - the offset index of cbuf to start reading characters to.len - the number of characters to read into the buffer.java.io.IOException - on error reading from the stream.public java.lang.String readLine()
throws java.io.IOException
java.io.IOException - on error reading from the stream.public boolean ready()
throws java.io.IOException
ready in class java.io.Readerjava.io.IOException - on error reading from the stream.public void reset()
reset in class java.io.Readerpublic long skip(long n)
throws java.io.IOException
skip in class java.io.Readerjava.io.IOException - on error reading from the stream.