首頁 >後端開發 >php教程 >PHP socket_write 如何与 java的readFully 对接?

PHP socket_write 如何与 java的readFully 对接?

WBOY
WBOY原創
2016-06-06 20:14:271005瀏覽

java端:

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

回复内容:

java端:

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

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

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn