当前位置: 技术问答>java相关
字节数组问题
来源: 互联网 发布时间:2015-05-22
本文导语: ByteArrayOutputStream byteOut=new ByteArrayOutputStream(); DataOutputStream out=new DataOutputStream(byteOut); out.writeInt(turnOutput); out.writeUTF(txtOutput.getText()); out.flush(); Byte[] buf=byteOut.toByteArray();这一句出错,错...
ByteArrayOutputStream byteOut=new ByteArrayOutputStream();
DataOutputStream out=new DataOutputStream(byteOut);
out.writeInt(turnOutput);
out.writeUTF(txtOutput.getText());
out.flush();
Byte[] buf=byteOut.toByteArray();这一句出错,错误是:"NetEcho.java": Error #: 354 : incompatible types; found: byte[], required: java.lang.Byte[] at line 66, column 35
DataOutputStream out=new DataOutputStream(byteOut);
out.writeInt(turnOutput);
out.writeUTF(txtOutput.getText());
out.flush();
Byte[] buf=byteOut.toByteArray();这一句出错,错误是:"NetEcho.java": Error #: 354 : incompatible types; found: byte[], required: java.lang.Byte[] at line 66, column 35
|
Byte[] buf这句错了
大小写错误,应该是
byte[] buf
大小写错误,应该是
byte[] buf