org.norther.tammi.acorn.io
Class WriterOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.norther.tammi.acorn.io.WriterOutputStream
All Implemented Interfaces:
Closeable, Flushable
Direct Known Subclasses:
HtmlOutputStream

public class WriterOutputStream
extends OutputStream

An output stream writing UTF-16 chars directly to a writer.

Note that BOMs are skipped.

Author:
Ilkka Priha

Constructor Summary
WriterOutputStream(Writer w)
          Constructs a new stream.
WriterOutputStream(Writer w, boolean s)
          Constructs a new stream optionally stripping the high order byte.
 
Method Summary
 void close()
           
 void flush()
           
 void write(byte[] bb, int off, int len)
           
protected  void write(char c)
          Writes one character.
 void write(int b)
           
protected  void write(String str)
          Writes a string.
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WriterOutputStream

public WriterOutputStream(Writer w)
Constructs a new stream.

Parameters:
w - the writer.

WriterOutputStream

public WriterOutputStream(Writer w,
                          boolean s)
Constructs a new stream optionally stripping the high order byte.

Parameters:
w - the writer.
s - true to strip, false otherwise.
Method Detail

write

public void write(int b)
           throws IOException
Specified by:
write in class OutputStream
Throws:
IOException

write

public void write(byte[] bb,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
Throws:
IOException

write

protected void write(char c)
              throws IOException
Writes one character.

Parameters:
c - the character.
Throws:
IOException - on I/O errors.

write

protected void write(String str)
              throws IOException
Writes a string.

Parameters:
str - the string.
Throws:
IOException - on I/O errors.


Copyright © 2004 The Norther Organization. All rights reserved.