XNIO API 3.0.7.GA

org.xnio.streams
Class WriterOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.xnio.streams.WriterOutputStream
All Implemented Interfaces:
Closeable, Flushable

public final class WriterOutputStream
extends OutputStream

An output stream which decodes bytes into a character writer.


Constructor Summary
WriterOutputStream(Writer writer)
          Construct a new instance.
WriterOutputStream(Writer writer, Charset charset)
          Construct a new instance.
WriterOutputStream(Writer writer, CharsetDecoder decoder)
          Construct a new instance.
WriterOutputStream(Writer writer, CharsetDecoder decoder, int bufferSize)
          Construct a new instance.
WriterOutputStream(Writer writer, String charsetName)
          Construct a new instance.
 
Method Summary
 void close()
          
 void flush()
          
 String toString()
          Get the string representation of this object.
 void write(byte[] b, int off, int len)
          
 void write(int b)
          
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WriterOutputStream

public WriterOutputStream(Writer writer)
Construct a new instance.

Parameters:
writer - the writer to decode into

WriterOutputStream

public WriterOutputStream(Writer writer,
                          CharsetDecoder decoder)
Construct a new instance.

Parameters:
writer - the writer to decode into
decoder - the charset decoder to use

WriterOutputStream

public WriterOutputStream(Writer writer,
                          CharsetDecoder decoder,
                          int bufferSize)
Construct a new instance.

Parameters:
writer - the writer to decode into
decoder - the charset decoder to use
bufferSize - the buffer size to use

WriterOutputStream

public WriterOutputStream(Writer writer,
                          Charset charset)
Construct a new instance.

Parameters:
writer - the writer to decode into
charset - the character set to use

WriterOutputStream

public WriterOutputStream(Writer writer,
                          String charsetName)
                   throws UnsupportedEncodingException
Construct a new instance.

Parameters:
writer - the writer to decode into
charsetName - the character set name to use
Throws:
UnsupportedEncodingException - if the character set name is unknown
Method Detail

write

public void write(int b)
           throws IOException

Specified by:
write in class OutputStream
Throws:
IOException

write

public void write(byte[] b,
                  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

toString

public String toString()
Get the string representation of this object.

Overrides:
toString in class Object
Returns:
the string

XNIO API 3.0.7.GA

Copyright © 2010 JBoss, a division of Red Hat, Inc.