Oracle

com.compoze.util
Class WriterOutputStream

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

public class WriterOutputStream
extends java.io.OutputStream

This class is an OutputStream that writes data to an underlying Writer. Bytes are converted to characters by creating a character with the most significant byte equal to zero.


Constructor Summary
WriterOutputStream(java.io.Writer writer)
          Constructor.
 
Method Summary
 void write(byte[] b)
          Write an array of bytes to the underlying writer.
 void write(byte[] b, int iOffset, int iLength)
          Write an array of bytes to the underlying writer.
 void write(int i)
          Write an int to the underlying writer.
 
Methods inherited from class java.io.OutputStream
close, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WriterOutputStream

public WriterOutputStream(java.io.Writer writer)
Constructor.

Parameters:
writer - the underlying writer
Method Detail

write

public void write(byte[] b)
           throws java.io.IOException
Write an array of bytes to the underlying writer.

Overrides:
write in class java.io.OutputStream
Parameters:
b - the array to write
Throws:
java.io.IOException - if an i/o error occurred

write

public void write(byte[] b,
                  int iOffset,
                  int iLength)
           throws java.io.IOException
Write an array of bytes to the underlying writer.

Overrides:
write in class java.io.OutputStream
Parameters:
b - the array to write
Throws:
java.io.IOException - if an i/o error occurred

write

public void write(int i)
           throws java.io.IOException
Write an int to the underlying writer. The upper two bytes of the integer are ignored. NOTE: This differs from the general contract of java.io.OutputStream which says that the upper three bytes are ignored.

Specified by:
write in class java.io.OutputStream
Parameters:
i - the integer to write
Throws:
java.io.IOException - if an i/o error occurred

Oracle

Copyright ©1999-2008 Oracle All rights reserved.