源代碼:byte[] bytes = new byte[1024];
int len = is.read(bytes);
System.out.println(new String(bytes,0,len));
錯誤提示:
String() in String cannot be applied to:
Expected Parameters:
Actual Arguments:
bytes (byte[])
0 (int)
len (int)
uj5u.com熱心網友回復:
byte[] buy = new byte[1024];int len = is.read(buy);
if (len > 0) {
String string = new String(buy, 0, len);
System.out.println("接受的訊息= "+string);
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/263989.html
標籤:Web 開發
上一篇:求教,如何實作用戶a的后臺管理頁面只有用戶a能訪問?
下一篇:assert str!= null; 和 if (!StringUtils.isEmpty(str)) {} 有什么區別
