DataInputStream in=new DataInputStream(ConnectedClient.getInputStream());
Byte bytes[]=new Byte[50];
int i=in.read(bytes);
以上这段代码通不过编译,提示如下
MySocketServer.java:45: cannot resolve symbol
symbol : method read (java.lang.Byte[])
location: class java.io.DataInputStream
int i=in.read(bytes);
^
Byte bytes[]=new Byte[50];
改成
byte[] bytes = new byte[50];
Byte是基本数据类型byte的封装类,这里应该用基本数据类型。
对,数据类型不对。