当前位置:Gxlcms > PHP教程 > PHPsocket_write如何与java的readFully对接?

PHPsocket_write如何与java的readFully对接?

时间:2021-07-01 10:21:17 帮助过:7人阅读

java端:

DataInputStream stream = new DataInputStream(new BufferedInputStream(socket.getInputStream, bufferSize))
int length = stream.readInt() 
byte[] obj = new byte[length]
stream.readFully(obj)

回复内容:

java端:

DataInputStream stream = new DataInputStream(new BufferedInputStream(socket.getInputStream, bufferSize))
int length = stream.readInt() 
byte[] obj = new byte[length]
stream.readFully(obj)

http://blog.csdn.net/guotong1988/article/details/50946032

人气教程排行