这是一篇测试主题效果的随笔,请忽略
1 package socketdemo; 2 3 import java.io.IOException; 4 import java.io.OutputStream; 5 import java.net.Socket; 6 import java.net.UnknownHostException; 7 import java.util.Calendar; 8 9 public class SocketClient { 10 11 public static void main(String[] args) { 12 // TODO Auto-generated method stub 13 try { 14 String info = "测试123\n"; 15 String info2 = "测试123456\n"; 16 // byte[] test = {0, 0, 0, -113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 49, 50, 56, 60, 88, 77, 76, 62, 60, 111, 112, 101, 114, 97, 116, 101, 95, 116, 121, 112, 101, 62, 51, 60, 47, 111, 112, 101, 114, 97, 116, 101, 95, 116, 121, 112, 101, 62, 60, 102, 105, 108, 101, 95, 110, 97, 109, 101, 62, 99, 111, 110, 102, 47, 109, 110, 103, 95, 112, 114, 111, 99, 46, 105, 110, 105, 60, 47, 102, 105, 108, 101, 95, 110, 97, 109, 101, 62, 60, 99, 114, 101, 97, 116, 101, 95, 100, 97, 116, 101, 62, 45, 49, 60, 47, 99, 114, 101, 97, 116, 101, 95, 100, 97, 116, 101, 62, 60, 111, 112, 116, 105, 111, 110, 62, 48, 60, 47, 111, 112, 116, 105, 111, 110, 62, 60, 47, 88, 77, 76, 62}; 17 byte[] test = info.getBytes(); 18 byte[] test2 = info2.getBytes(); 19 Socket socket = new Socket("127.0.0.1",10014); 20 OutputStream outputStream = socket.getOutputStream(); 21 outputStream.write(test); 22 outputStream.write(test2); 23 try { 24 Thread.currentThread().sleep(30000); 25 } catch (InterruptedException e) { 26 // TODO Auto-generated catch block 27 e.printStackTrace(); 28 } 29 // outputStream.write(test); 30 } catch (UnknownHostException e) { 31 // TODO Auto-generated catch block 32 e.printStackTrace(); 33 } catch (IOException e) { 34 // TODO Auto-generated catch block 35 e.printStackTrace(); 36 } 37 } 38 39 }
标签:效果,32,主题,60,62,116,测试,101,97 From: https://www.cnblogs.com/yijunjiechen/p/17474598.html