public class BufferedReader extends Reader
| Constructor and Description |
|---|
BufferedReader(Reader reader)
Creates a buffered stream from the Reader class.
|
BufferedReader(Reader reader,
int bufsiz)
Creates a buffered stream from the Reader class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the stream
|
void |
mark(int limit)
Marks a position in the buffered stream.
|
boolean |
markSupported()
Indicates whether a stream supports the marking feature.
|
int |
read()
Reads a single character.
|
int |
read(char[] arr,
int ofs,
int len)
Reads characters into part of a character array.
|
String |
readLine()
Returns the next line of text from the stream (blocking).
|
boolean |
ready()
Indicates that there is data ready to be read.
|
void |
reset()
Resets the buffer pointer.
|
long |
skip(long len)
Skips the specified number of characters in the stream (blocking).
|
boolean |
terminated()
Indicates if the last readLine() was terminated.
|
public BufferedReader(Reader reader)
reader - Reader stream object?public BufferedReader(Reader reader, int bufsiz)
reader - Reader stream objectbufsiz - Desired buffer size?public void close()
throws IOException
close in class ReaderIOException - with any errorpublic void mark(int limit)
throws IOException
mark in class Readerlimit - the maximum to be buffered following the markIOException - with possible errorpublic boolean markSupported()
markSupported in class Readerpublic int read()
throws IOException
read in class ReaderIOException - with errorpublic int read(char[] arr,
int ofs,
int len)
throws IOException
read in class Readerarr - the character array to receive dataofs - position in the character array to be modifiedlen - maximum number of character to readIOException - with errorspublic String readLine() throws IOException
IOException - if stream closedpublic boolean terminated()
public boolean ready()
throws IOException
ready in class ReaderIOException - with any errorpublic void reset()
throws IOException
reset in class ReaderIOException - if mark() has not been calledpublic long skip(long len)
throws IOException
skip in class Readerlen - count of characters to skipIOException - with any error