我有通过 telnet 协议与路由器通信的类。我可以发送文本字符串:
s = new Socket("201.20.2.3",23);
inputStream = s.getInputStream();
outputStream = s.getOutputStream();
outputStream.write( ("admin\n") .getBytes());
Thread.sleep(100);
outputStream.write("24\n".getBytes());
所以 \n 就像一个 Enter 按钮。但是如何在那里发送一个 Escape 按钮呢?