这是发生问题的代码片段:
public static byte[] copyLargeExt(InputStream input) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buffer = new byte[1024*8];
int n = 0;
while(-1 != (n = input.read(buffer))) {
baos.write(buffer, 0, n);
// i just append this pattern ({###END###}) to force the break
/*if(baos.toString(UTF8.name()).endsWith("{###END###}")) {
break;
}*/
}
return baos.toByteArray();
}
有人能帮我吗?