- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable
public class OutputStreamAdapter
extends java.io.OutputStream
This class let a Writer be viewed as an OutputStream.
The write() method takes an integer b:
- if b is -1, -1 is written (end of stream)
- otherwise the lowest byte of b is written
Since writers deal with characters, they usually buffer
some data and then flush when '-1' or '\n' is received.
OutputStreams (usually) don't do buffering, so we're flushing
the stream everytime a byte is written.
- Author:
- Andrea Bucaletti