com.twelvemonkeys.io
Class WriterOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by com.twelvemonkeys.io.WriterOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class WriterOutputStream
extends OutputStream

Wraps a Writer in an OutputStream.

Instances of this class are not thread-safe.

NOTE: This class is probably not the right way of solving your problem, however it might prove useful in JSPs etc. If possible, it's always better to use the Writer's underlying OutputStream, or wrap it's native backing.

Version:
$Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/WriterOutputStream.java#2 $
Author:
Harald Kuhr

Field Summary
protected  com.twelvemonkeys.io.WriterOutputStream.Decoder decoder
           
protected  Writer writer
           
 
Constructor Summary
WriterOutputStream(Writer pWriter)
           
WriterOutputStream(Writer pWriter, String pCharset)
           
 
Method Summary
 void close()
           
 void flush()
           
static void main(String[] pArgs)
           
 void write(byte[] pBytes)
           
 void write(byte[] pBytes, int pOffset, int pLength)
           
 void write(int pByte)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

writer

protected Writer writer

decoder

protected final com.twelvemonkeys.io.WriterOutputStream.Decoder decoder
Constructor Detail

WriterOutputStream

public WriterOutputStream(Writer pWriter,
                          String pCharset)

WriterOutputStream

public WriterOutputStream(Writer pWriter)
Method Detail

close

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

flush

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

write

public final void write(byte[] pBytes)
                 throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

write

public final void write(byte[] pBytes,
                        int pOffset,
                        int pLength)
                 throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

write

public final void write(int pByte)
Specified by:
write in class OutputStream

main

public static void main(String[] pArgs)
                 throws IOException
Throws:
IOException


Copyright © 2015. All Rights Reserved.