public class WriterStream
extends java.io.OutputStream
Constructor and Description |
---|
WriterStream(java.io.Writer w)
Create a stream that writes to a writer.
|
WriterStream(java.io.Writer w,
java.lang.String charsetName)
Create a stream that writes to a writer.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
We override default implementation to write last characters,
which could be lost in buffer otherwise.
|
void |
flush()
Flush the stream.
|
void |
write(int b)
OutputStream's implementation.
|
public WriterStream(java.io.Writer w)
w
- the writerpublic WriterStream(java.io.Writer w, java.lang.String charsetName)
w
- the writercharsetName
- name of encoding to be used when decode byte stream
(instead of default one)public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
- if an I/O error occurspublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
b
- next byte from OutputStream to write.java.io.IOException
Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.