FlexOr.io
Class BufferedOutput

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.io.BufferedOutputStream
              extended by FlexOr.io.BufferedOutput
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class BufferedOutput
extends java.io.BufferedOutputStream


Constructor Summary
BufferedOutput(java.lang.String fileName)
          Creating an instance of BufferedOutput opens the named file.
 
Method Summary
 int getCharCount()
           
 int getLineLength()
           
 int getTabStopDist()
           
 void setTabStopDist(int tabStopDist)
           
 void write(byte[] buffer, int offset, int count)
          ---------------------------
 void write(int theChar)
          ---------------------------
 void writeInteger(int integer)
          We make use of the standard Java conversion routine combined with our custom output of strings.
 void writeInteger(int integer, int width)
          Require: String.valueOf(integer).length <= width Output an integer in a specified width of field.
 void writeNewline()
          When a new line character is emitted we want to reset lineLength.
 void writeNoCount(byte[] buffer, int offset, int count)
          Occasionally we need to output to the current line without adding to the line length (for example, when markup tags are output).
 
Methods inherited from class java.io.BufferedOutputStream
flush
 
Methods inherited from class java.io.FilterOutputStream
close, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferedOutput

public BufferedOutput(java.lang.String fileName)
               throws java.io.IOException
Creating an instance of BufferedOutput opens the named file. There is no open required by the user. In the OO paradigm opening a file is analogous to creating a new object unlike procedural paradigm where the same variables are reused for each file. ---------------------------

Throws:
java.io.IOException
Method Detail

getCharCount

public int getCharCount()

getLineLength

public int getLineLength()

getTabStopDist

public int getTabStopDist()

setTabStopDist

public void setTabStopDist(int tabStopDist)

write

public void write(int theChar)
---------------------------

Overrides:
write in class java.io.BufferedOutputStream

writeNewline

public void writeNewline()
When a new line character is emitted we want to reset lineLength. Again, having a special purpose parameterless call is more efficient and descriptive in application programs. ---------------------------


write

public void write(byte[] buffer,
                  int offset,
                  int count)
---------------------------

Overrides:
write in class java.io.BufferedOutputStream

writeNoCount

public void writeNoCount(byte[] buffer,
                         int offset,
                         int count)
Occasionally we need to output to the current line without adding to the line length (for example, when markup tags are output). The following operation prints directly to the output file. The total number of output characters is incremented but the line length is not. ---------------------------


writeInteger

public void writeInteger(int integer)
We make use of the standard Java conversion routine combined with our custom output of strings. ---------------------------


writeInteger

public void writeInteger(int integer,
                         int width)
Require: String.valueOf(integer).length <= width Output an integer in a specified width of field. ---------------------------