public final class FromNetASCIIOutputStream extends FilterOutputStream
Because of the translation process, a call to flush()
will
not flush the last byte written if that byte was a carriage
return. A call to close()
, however, will
flush the carriage return.
out
Constructor and Description |
---|
FromNetASCIIOutputStream(OutputStream output)
Creates a FromNetASCIIOutputStream instance that wraps an existing
OutputStream.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the stream, writing all pending data.
|
void |
write(byte[] buffer)
Writes a byte array to the stream.
|
void |
write(byte[] buffer,
int offset,
int length)
Writes a number of bytes from a byte array to the stream starting from
a given offset.
|
void |
write(int ch)
Writes a byte to the stream.
|
flush
public FromNetASCIIOutputStream(OutputStream output)
output
- The OutputStream to wrap.public void write(int ch) throws IOException
write
in class FilterOutputStream
ch
- The byte to write.IOException
- If an error occurs while writing to the underlying
stream.public void write(byte[] buffer) throws IOException
write
in class FilterOutputStream
buffer
- The byte array to write.IOException
- If an error occurs while writing to the underlying
stream.public void write(byte[] buffer, int offset, int length) throws IOException
write
in class FilterOutputStream
buffer
- The byte array to write.offset
- The offset into the array at which to start copying data.length
- The number of bytes to write.IOException
- If an error occurs while writing to the underlying
stream.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class FilterOutputStream
IOException
- If an error occurs while closing the stream.Copyright © 2001–2016 The Apache Software Foundation. All rights reserved.