GXPARSE hosted by SourceForge.net Logo

ca.gorman.io
Class BinaryFileWriter

java.lang.Object
  extended by java.io.Writer
      extended by ca.gorman.io.BinaryFileWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class BinaryFileWriter
extends Writer

Convenience class for writing characters to a File without translation to a Charset.


Field Summary
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
BinaryFileWriter(File file)
           Construct on a File.
 
Method Summary
 void close()
           Close the stream, after flushing it.
 void flush()
           Flush the stream, writing any buffered characters out to the File.
 void write(char[] cbuf, int off, int len)
           Write characters.
 void write(int c)
           Write a single character.
 
Methods inherited from class java.io.Writer
append, append, append, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryFileWriter

public BinaryFileWriter(File file)
                 throws IOException

Construct on a File.

Throws:
NullPointerException - if file is null
IOException
Method Detail

write

public void write(int c)
           throws IOException

Write a single character.

Overrides:
write in class Writer
Parameters:
c - an int that contains the character in the low 16-bits.
Throws:
IOException

write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws IOException

Write characters.

Specified by:
write in class Writer
Parameters:
cbuf - characters to write
off - offset to first character
len - number to write
Throws:
IndexOutOfBoundsException - if off, len, or their sum have values that would identify characters outside the bounds of the array.
NullPointerException - if cbuf is null
IOException

close

public void close()
           throws IOException

Close the stream, after flushing it. Any subsequent invocations of this method will be ignored, but subsequent invocations of write and flush methods will throw an IOException.

Specified by:
close in interface Closeable
Specified by:
close in class Writer
Throws:
IOException

flush

public void flush()
           throws IOException

Flush the stream, writing any buffered characters out to the File.

Specified by:
flush in interface Flushable
Specified by:
flush in class Writer
Throws:
IOException

GXPARSE download

GXPARSE Generic XML Stream Parser API and supporting tools.   Release $Name: gxparse-sf-alpha-2_0 $
Copyright 2003-2004 Ian E. Gorman
Released under GNU Lesser General Public License