나는 아래의 코드와 같이 행의 경우 ArrayIndexOutOfBoundsException 받고 있어요 : 내가 틀렸다 곳예외 : 널 (null) 클래스 : 클래스 java.lang.ArrayIndexOutOfBoundsException
String boundaryMessage = getBoundaryMessage(boundary, fileField, fileName, fileType);
String endBoundary = "\r\n--" + boundary + "--\r\n";
byte[] temp = new byte[boundaryMessage.getBytes().length+fileBytes.length+endBoundary.getBytes().length];
temp = boundaryMessage.getBytes();
try {
System.arraycopy(fileBytes, 0, temp, temp.length, fileBytes.length); //exception thrown here
System.arraycopy(endBoundary.getBytes(), 0, temp, temp.length, endBoundary.getBytes().length);
}
catch(Exception e){
System.out.println("====Exception: "+e.getMessage()+" Class: "+e.getClass());
}
누군가가 날 지점 수 있습니다. 감사.
정말 달성하고 싶습니다 fileBytes 배열을 내 임시 배열에 복사하는 것입니다. 그래서 내가 이렇게 해왔다. 나는 처음부터 배열의 공간을 이미 지정했다. 무엇을 더해야할까요? –