jist.swans.app.io
Class BufferedReader

java.lang.Object
  extended by java.io.Reader
      extended by java.io.BufferedReader
          extended by jist.swans.app.io.BufferedReader
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable

public class BufferedReader
extends java.io.BufferedReader

A functionally identical port of java.io.BufferedReader, primarily brought into jist.swans.app.io package so that it could be dynamically rewritten.

Since:
SWANS1.0
Version:
$Id: BufferedReader.java,v 1.5 2004/04/06 16:07:46 barr Exp $
Author:
Sun Microsystems, Rimon Barr <barr+jist@cs.cornell.edu>

Field Summary
private  char[] cb
          buffer.
private static int defaultCharBufferSize
          buffer size.
private static int defaultExpectedLineLength
          expected input line length.
private  Reader in
          underlying reader.
private static int INVALIDATED
          marking constant.
private  int markedChar
          marking status.
private  boolean markedSkipLF
          The skipLF flag when the mark was set.
private  int nChars
          indices.
private  int nextChar
          indices.
private  int readAheadLimit
          limit for reading ahead; valid only when markedChar greater than 0.
private  boolean skipLF
          If the next character is a line feed, skip it.
private static int UNMARKED
          marking constant.
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
BufferedReader(Reader in)
           
BufferedReader(Reader in, int sz)
           
 
Method Summary
 void close()
           
private  void ensureOpen()
           
private  void fill()
           
 void mark(int readAheadLimit)
           
 boolean markSupported()
           
 int read()
           
 int read(char[] cbuf, int off, int len)
           
private  int read1(char[] cbuf, int off, int len)
           
 java.lang.String readLine()
           
(package private)  java.lang.String readLine(boolean ignoreLF)
           
 boolean ready()
           
 void reset()
           
 long skip(long n)
           
 
Methods inherited from class java.io.Reader
read, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

in

private Reader in
underlying reader.


cb

private char[] cb
buffer.


nChars

private int nChars
indices.


nextChar

private int nextChar
indices.


INVALIDATED

private static final int INVALIDATED
marking constant.

See Also:
Constant Field Values

UNMARKED

private static final int UNMARKED
marking constant.

See Also:
Constant Field Values

markedChar

private int markedChar
marking status.


readAheadLimit

private int readAheadLimit
limit for reading ahead; valid only when markedChar greater than 0.


skipLF

private boolean skipLF
If the next character is a line feed, skip it.


markedSkipLF

private boolean markedSkipLF
The skipLF flag when the mark was set.


defaultCharBufferSize

private static int defaultCharBufferSize
buffer size.


defaultExpectedLineLength

private static int defaultExpectedLineLength
expected input line length.

Constructor Detail

BufferedReader

public BufferedReader(Reader in,
                      int sz)
See Also:
BufferedReader

BufferedReader

public BufferedReader(Reader in)
See Also:
BufferedReader
Method Detail

ensureOpen

private void ensureOpen()
                 throws java.io.IOException
Throws:
java.io.IOException
See Also:
BufferedReader

fill

private void fill()
           throws java.io.IOException
Throws:
java.io.IOException
See Also:
BufferedReader

read

public int read()
         throws java.io.IOException,
                JistAPI.Continuable
Overrides:
read in class java.io.BufferedReader
Throws:
java.io.IOException
JistAPI.Continuable
See Also:
BufferedReader

read1

private int read1(char[] cbuf,
                  int off,
                  int len)
           throws java.io.IOException,
                  JistAPI.Continuable
Throws:
java.io.IOException
JistAPI.Continuable
See Also:
BufferedReader

read

public int read(char[] cbuf,
                int off,
                int len)
         throws java.io.IOException,
                JistAPI.Continuable
Overrides:
read in class java.io.BufferedReader
Throws:
java.io.IOException
JistAPI.Continuable
See Also:
BufferedReader

readLine

java.lang.String readLine(boolean ignoreLF)
                    throws java.io.IOException,
                           JistAPI.Continuable
Throws:
java.io.IOException
JistAPI.Continuable
See Also:
BufferedReader

readLine

public java.lang.String readLine()
                          throws java.io.IOException,
                                 JistAPI.Continuable
Overrides:
readLine in class java.io.BufferedReader
Throws:
java.io.IOException
JistAPI.Continuable
See Also:
BufferedReader

skip

public long skip(long n)
          throws java.io.IOException,
                 JistAPI.Continuable
Overrides:
skip in class java.io.BufferedReader
Throws:
java.io.IOException
JistAPI.Continuable
See Also:
BufferedReader

ready

public boolean ready()
              throws java.io.IOException,
                     JistAPI.Continuable
Overrides:
ready in class java.io.BufferedReader
Throws:
java.io.IOException
JistAPI.Continuable
See Also:
BufferedReader

markSupported

public boolean markSupported()
                      throws JistAPI.Continuable
Overrides:
markSupported in class java.io.BufferedReader
Throws:
JistAPI.Continuable
See Also:
BufferedReader

mark

public void mark(int readAheadLimit)
          throws java.io.IOException,
                 JistAPI.Continuable
Overrides:
mark in class java.io.BufferedReader
Throws:
java.io.IOException
JistAPI.Continuable
See Also:
BufferedReader

reset

public void reset()
           throws java.io.IOException,
                  JistAPI.Continuable
Overrides:
reset in class java.io.BufferedReader
Throws:
java.io.IOException
JistAPI.Continuable
See Also:
BufferedReader

close

public void close()
           throws java.io.IOException,
                  JistAPI.Continuable
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.BufferedReader
Throws:
java.io.IOException
JistAPI.Continuable
See Also:
BufferedReader