com.isti.util
Class WriterOutputStream

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

public class WriterOutputStream
extends java.io.OutputStream

Class WriterOutputStream converts a 'Writer' to an 'OutputStream'.


Field Summary
protected  java.io.Writer writerObj
           
 
Constructor Summary
WriterOutputStream(java.io.Writer writerObj)
          Creates a 'Writer' to 'OutputStream' converter.
 
Method Summary
 void close()
          Closes the stream.
 void flush()
          Flushes the stream.
 void write(byte[] data)
          Writes the given data array.
 void write(byte[] data, int start, int len)
          Writes the given section of the given array.
 void write(int ch)
          Writes a character.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

writerObj

protected final java.io.Writer writerObj
Constructor Detail

WriterOutputStream

public WriterOutputStream(java.io.Writer writerObj)
Creates a 'Writer' to 'OutputStream' converter.

Parameters:
writerObj - the source 'Writer' object.
Method Detail

write

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

Specified by:
write in class java.io.OutputStream
Parameters:
ch - character
Throws:
java.io.IOException

write

public void write(byte[] data)
           throws java.io.IOException
Writes the given data array.

Overrides:
write in class java.io.OutputStream
Parameters:
data - data array
Throws:
java.io.IOException

write

public void write(byte[] data,
                  int start,
                  int len)
           throws java.io.IOException
Writes the given section of the given array.

Overrides:
write in class java.io.OutputStream
Parameters:
data - data array
start - start index
len - length
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Flushes the stream.

Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.OutputStream
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Closes the stream.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream
Throws:
java.io.IOException