jist.swans.app.io
Class BufferedWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.BufferedWriter
          extended by jist.swans.app.io.BufferedWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class BufferedWriter
extends java.io.BufferedWriter

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

Since:
SWANS1.0
Version:
$Id: BufferedWriter.java,v 1.4 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  java.lang.String lineSeparator
          end-of-line.
private  int nChars
          indices.
private  int nextChar
          indices.
private  Writer out
          underlying writer.
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
BufferedWriter(Writer out)
           
BufferedWriter(Writer out, int sz)
           
 
Method Summary
 void close()
           
private  void ensureOpen()
           
 void flush()
           
(package private)  void flushBuffer()
           
private  int min(int a, int b)
           
 void newLine()
           
 void write(char[] cbuf, int off, int len)
           
 void write(int c)
           
 void write(java.lang.String s, int off, int len)
           
 
Methods inherited from class java.io.Writer
append, append, append, append, append, append, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

private Writer out
underlying writer.


cb

private char[] cb
buffer.


nChars

private int nChars
indices.


nextChar

private int nextChar
indices.


defaultCharBufferSize

private static int defaultCharBufferSize
buffer size.


lineSeparator

private java.lang.String lineSeparator
end-of-line.

Constructor Detail

BufferedWriter

public BufferedWriter(Writer out)
See Also:
BufferedWriter

BufferedWriter

public BufferedWriter(Writer out,
                      int sz)
See Also:
BufferedWriter
Method Detail

ensureOpen

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

flushBuffer

void flushBuffer()
           throws java.io.IOException,
                  JistAPI.Continuable
Throws:
java.io.IOException
JistAPI.Continuable
See Also:
BufferedWriter

write

public void write(int c)
           throws java.io.IOException,
                  JistAPI.Continuable
Overrides:
write in class java.io.BufferedWriter
Throws:
java.io.IOException
JistAPI.Continuable
See Also:
BufferedWriter

min

private int min(int a,
                int b)
See Also:
BufferedWriter

write

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

write

public void write(java.lang.String s,
                  int off,
                  int len)
           throws java.io.IOException,
                  JistAPI.Continuable
Overrides:
write in class java.io.BufferedWriter
Throws:
java.io.IOException
JistAPI.Continuable
See Also:
BufferedWriter

newLine

public void newLine()
             throws java.io.IOException
Overrides:
newLine in class java.io.BufferedWriter
Throws:
java.io.IOException
See Also:
BufferedWriter

flush

public void flush()
           throws java.io.IOException,
                  JistAPI.Continuable
Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.BufferedWriter
Throws:
java.io.IOException
JistAPI.Continuable
See Also:
BufferedWriter

close

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