+ byte [] buffer = null;
+ if (master.binaryMode) {
+ // Binary mode: read up to len bytes. There will never be
+ // more bytes to pass upstream than there are bytes on the
+ // wire.
+ buffer = new byte[len];
+ } else {
+ // ASCII mode: read up to len - 2 bytes. There may have been
+ // some combination of IAC, CR, and NUL from a previous
+ // readImpl() that could result in more bytes to pass up than
+ // are on the wire.
+ buffer = new byte[len - 2];
+ }
+