|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream tribble.io.WriterOutputStream
public class WriterOutputStream
Pass-through character writer stream.
Writes characters to an underlying Writer
object, writing individual
output bytes as 8-bit character codes. This is effectively a character stream
that writes ISO 8859-1 character codes as uninterpreted single-byte
sequences, i.e., each character code is composed of a single 8-bit octet
written to the output stream.
This class is essentially the inverse of class
OutputStreamWriter
.
ReaderInputStream
,
PassThruWriter
,
OutputStreamWriter
Field Summary | |
---|---|
protected java.io.Writer |
m_out
Underlying output stream writer. |
protected static java.lang.String |
NEWLINE
Platform-specific newline character sequence. |
(package private) static java.lang.String |
REV
Revision information. |
Constructor Summary | |
---|---|
WriterOutputStream(java.io.Writer out)
Constructor. |
Method Summary | |
---|---|
void |
close()
Flush and close this output stream. |
void |
flush()
Flush any pending output to this output stream. |
void |
newLine()
Write a newline sequence to this output stream. |
void |
write(byte[] buf)
Write a group of characters. |
void |
write(byte[] buf,
int off,
int len)
Write a group of characters. |
void |
write(int ch)
Write a single character. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final java.lang.String REV
protected static final java.lang.String NEWLINE
protected java.io.Writer m_out
Constructor Detail |
---|
public WriterOutputStream(java.io.Writer out)
out
- Underlying output stream, which provides a destination for output bytes.Method Detail |
---|
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.OutputStream
java.io.IOException
- Thrown if an I/O error occurs while closing the underlying output writer.public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
- Thrown if an I/O error occurs while closing the underlying output writer.public void write(int ch) throws java.io.IOException
write
in class java.io.OutputStream
ch
- A character byte. Only the lower 8 bits of the character are used
(yielding characters in the range [0x0000,0x00FF]).
java.io.IOException
- Thrown if an I/O error occurs while writing to the underlying output
writer.public void write(byte[] buf) throws java.io.IOException
This method has exactly the same effect as the call: write(buf, 0, buf.length).
write
in class java.io.OutputStream
buf
- (const)
An array of character bytes to be written.
Each byte represents a single 8-bit character code in the range
[0x0000,0x00FF].
java.io.IOException
- Thrown if an I/O error occurs while writing to the underlying output
writer.public void write(byte[] buf, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
buf
- (const)
An array of character bytes to be written.
Each byte represents a single 8-bit character code in the range
[0x0000,0x00FF].off
- Index of the first character in buf to write.len
- Number of characters in buf to write.
java.io.IOException
- Thrown if an I/O error occurs while writing to the underlying output
writer.public void newLine() throws java.io.IOException
If the underlying stream is a PrintWriter
, its
println() method is called;
if the stream is a BufferedWriter
, its newLine()
method is called;
otherwise, the native newline character sequence is written to it by
calling its write() method.
java.io.IOException
- Thrown if an I/O error occurs while writing to the underlying output
writer.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |