final class TelnetOutputStream
extends java.io.OutputStream
In binary mode, the only conversion is to double IAC.
In ASCII mode, if convertCRtoCRLF is true (currently always true), any CR is converted to CRLF. IACs are doubled. Also a bare LF is converted to CRLF and a bare CR is converted to CR\0
Modifier and Type | Field and Description |
---|---|
private TelnetClient |
__client |
private boolean |
__convertCRtoCRLF |
private boolean |
__lastWasCR |
Constructor and Description |
---|
TelnetOutputStream(TelnetClient client) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the stream.
|
void |
flush()
Flushes the stream.
|
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.
|
private final TelnetClient __client
private final boolean __convertCRtoCRLF
private boolean __lastWasCR
TelnetOutputStream(TelnetClient client)
public void write(int ch) throws java.io.IOException
write
in class java.io.OutputStream
ch
- The byte to write.java.io.IOException
- If an error occurs while writing to the underlying
stream.public void write(byte[] buffer) throws java.io.IOException
write
in class java.io.OutputStream
buffer
- The byte array to write.java.io.IOException
- If an error occurs while writing to the underlying
stream.public void write(byte[] buffer, int offset, int length) throws java.io.IOException
write
in class java.io.OutputStream
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.java.io.IOException
- If an error occurs while writing to the underlying
stream.public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public 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