tribble.io
Class PassThruWriter

java.lang.Object
  extended by java.io.Writer
      extended by tribble.io.PassThruWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class PassThruWriter
extends java.io.Writer

Pass-through character writer stream.

Writes characters to an underlying OutputStream object, writing each Unicode character code as a single byte. This is effectively a character stream that writes ISO 8859-1 character codes as uninterpreted single-byte sequences, i.e., each character code is composed of a single 8-bit octet written to the output stream.

Since:
2005-04-05
Version:
$Revision: 1.1 $ $Date: 2005/04/06 04:36:39 $
Author:
David R. Tribble (david@tribble.com).
Copyright 2005 by David R. Tribble, all rights reserved.
Permission is granted to freely use and distribute this source code provided that the original copyright and authorship notices remain intact.
See Also:
PassThruReader

Field Summary
protected  java.io.OutputStream m_out
          Underlying byte output stream.
(package private) static java.lang.String REV
          Revision information.
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
PassThruWriter(java.io.OutputStream out)
          Constructor.
 
Method Summary
 void close()
          Flush and close this output stream.
 void flush()
          Flush any pending output to this output stream.
 void write(char[] buf, int off, int len)
          Write a group of characters.
 void write(int ch)
          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
 

Field Detail

REV

static final java.lang.String REV
Revision information.

See Also:
Constant Field Values

m_out

protected java.io.OutputStream m_out
Underlying byte output stream.

Constructor Detail

PassThruWriter

public PassThruWriter(java.io.OutputStream out)
Constructor.

Parameters:
out - Underlying output stream, which provides a destination for output bytes.
Since:
1.1, 2005-04-05
Method Detail

close

public void close()
           throws java.io.IOException
Flush and close this output stream.

Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Writer
Throws:
java.io.IOException - Thrown if an I/O error occurs while closing the underlying output stream.
Since:
1.1, 2005-04-05

flush

public void flush()
           throws java.io.IOException
Flush any pending output to this output stream.

Specified by:
flush in interface java.io.Flushable
Specified by:
flush in class java.io.Writer
Throws:
java.io.IOException - Thrown if an I/O error occurs while closing the underlying output stream.
Since:
1.1, 2005-04-05

write

public void write(int ch)
           throws java.io.IOException
Write a single character.

Overrides:
write in class java.io.Writer
Parameters:
ch - A Unicode character code. Only the lower 8 bits of the character are used (yielding characters in the range [0x0000,0x00FF]).
Throws:
java.io.IOException - Thrown if an I/O error occurs while writing the underlying output stream.
Since:
1.1, 2005-04-05

write

public void write(char[] buf,
                  int off,
                  int len)
           throws java.io.IOException
Write a group of characters.

Specified by:
write in class java.io.Writer
Parameters:
buf - An array of Unicode characters to be written. Only the lower 8 bits of each character are used (yielding characters in the range [0x0000,0x00FF]).
off - Index of the first character in buf to write.
len - Number of characters in buf to write.
Throws:
java.io.IOException - Thrown if an I/O error occurs while writing the underlying output stream.
Since:
1.1, 2005-04-05