【发布时间】:2019-07-27 01:36:17
【问题描述】:
private DataOutputStream output = null;
private int send(String str) throws IOException {
int response = 0;
output.writeBytes(str);
output.flush();
return response;
}
在将 String 写入 writeBytes 时,它会抛出类似的错误 java.net.SocketException:软件导致连接中止:套接字写入错误 java.lang.ArrayIndexOutOfBoundsException: 512
调试 McFee:123 - 异常 java.net.SocketException:软件导致连接中止:套接字写入错误 McaFeeC:83 - 请求标头 **** GET http://localhost:8080/appApp\filepath\ACH_IMAGE_FIVE_TWO_FIVE_zip HTTP/1.1
【问题讨论】:
-
我们看不到“输出”的初始化,但要小心writeBytes(string),可怕的方法
-
能否向我们提供异常的完整堆栈跟踪以及引发错误的代码?
-
DataOutputStream此处未初始化。你也可以粘贴异常的wole堆栈跟踪吗? -
DEBUG McFee:123 - 异常 java.net.SocketException: 软件导致连接中止:套接字写入错误 McaFeeC:83 - 请求标头 **** GET localhost:8080/appApp\filepath\ACH_IMAGE_FIVE_TWO_FIVE_zip HTTP/1.1
-
实际上我在 zip 文件中上传了 600 张图片,然后它抛出了异常。如果我在 zip 文件中上传 500 张图片,它不会抛出任何异常。
标签: java