: This article mainly introduces the connection between PHPsocket implementation and Java readFully. if you are interested in PHP tutorials, please refer to it. Java:
DataInputStream stream = new DataInputStream (new BufferedInputStream (socket. getInputStream (); int I = stream. readInt (); byte [] B = newbyte [I]; stream. readFully (B); System. out. println (new String (B ));
Php:
FunctionwriteInt ($ socket, $ I) {$ data = pack ('N', $ I); socket_write ($ socket, $ data);} writeInt ($ sock, strlen ("ZXCV"); socket_write ($ sock, "ZXCV", strlen ("ZXCV "));
'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
'). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script
The above introduces the PHP socket implementation and the Java readFully connection, including the content, hope to be helpful to friends who are interested in the PHP Tutorial.