Rumah >pembangunan bahagian belakang >tutorial php >PHP socket_write 如何与 java的readFully 对接?
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