java.lang.NumberFormatException: For input string: ""
java.lang.NumberFormatException:Forinputstring:""atjava.lang.NumberFormatException.fo...
java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:489)
at java.lang.Integer.parseInt(Integer.java:518)
at com.sinosoft.application.common.SendUtils.getPackageLength(SendUtils.java:138)
at com.sinosoft.application.common.SendUtils.tcpSendReceiver(SendUtils.java:112)
at com.sinosoft.application.agent.web.action.Test_JH.main(Test_JH.java:92)
行数代码:
SendUtils.java:138-----int length = Integer.parseInt(new String(lengthArray).trim());
SendUtils.java:112-----int intLength = getPackageLength(is);
Test_JH.java:92-----testdata = sendUtils.tcpSendReceiver("10.75.41.74", 9016, testdata);
BufferedInputStream is = new BufferedInputStream(socket.getInputStream());
System.out.println("----is---"+is);
int c;
int intLength = getPackageLength(is);
socket接收数据socket.getInputStream(),放到了BufferedInputStream里然后定义byte数组
byte[] lengthArray = new byte[6];然后读is.read(lengthArray);然后放到String里int length = Integer.parseInt(new String(lengthArray).trim());转换成int 展开
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:489)
at java.lang.Integer.parseInt(Integer.java:518)
at com.sinosoft.application.common.SendUtils.getPackageLength(SendUtils.java:138)
at com.sinosoft.application.common.SendUtils.tcpSendReceiver(SendUtils.java:112)
at com.sinosoft.application.agent.web.action.Test_JH.main(Test_JH.java:92)
行数代码:
SendUtils.java:138-----int length = Integer.parseInt(new String(lengthArray).trim());
SendUtils.java:112-----int intLength = getPackageLength(is);
Test_JH.java:92-----testdata = sendUtils.tcpSendReceiver("10.75.41.74", 9016, testdata);
BufferedInputStream is = new BufferedInputStream(socket.getInputStream());
System.out.println("----is---"+is);
int c;
int intLength = getPackageLength(is);
socket接收数据socket.getInputStream(),放到了BufferedInputStream里然后定义byte数组
byte[] lengthArray = new byte[6];然后读is.read(lengthArray);然后放到String里int length = Integer.parseInt(new String(lengthArray).trim());转换成int 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询