encapsulation
true
True
478479480481482483484485486487488
byte[] boundary = contentType.substring(boundaryIndex + 9).getBytes(); ByteArrayInputStream input = new ByteArrayInputStream(body); MultipartStream multi = new MultipartStream(input, boundary); boolean nextPart = multi.skipPreamble(); while (nextPart) { try { output = new ByteArrayOutputStream(); multi.readBodyData(output); outputArray = output.toByteArray();
115116117118119120121122123124125
contentType.indexOf("boundary=")+9).getBytes(); InputStream input = (InputStream)req.getInputStream(); MultipartStream multi = new MultipartStream(input, boundary); multi.setHeaderEncoding(encoding); boolean nextPart = multi.skipPreamble(); while(nextPart) { Map headers = parseHeaders(multi.readHeaders()); String fieldName = getFieldName(headers); if (fieldName != null)
132133134135136137138139140141142
byte[] subBoundary = subContentType.substring( subContentType .indexOf("boundary=")+9).getBytes(); multi.setBoundary(subBoundary); boolean nextSubPart = multi.skipPreamble(); while (nextSubPart) { headers = parseHeaders(multi.readHeaders()); if (getFileName(headers) != null) {
450451452453454455456457458459460
3233343536373839404142
ByteArrayInputStream bis = new ByteArrayInputStream(barr); MultipartStream stream; Array result = new ArrayImpl(); stream = new MultipartStream(bis,getBytes(boundary,"UTF-8"));// boolean hasNextPart = stream.skipPreamble(); while (hasNextPart) { result.append(getPartData(stream)); hasNextPart = stream.readBoundary(); } return result;
181182183184185186187188189190191
logger.debug("Parsing..."); MultipartStream multipartStream = new MultipartStream(input, boundary); ArrayList<RetrieveMMSMessageResponse.Attachment> attachments=new ArrayList<RetrieveMMSMessageResponse.Attachment>(); boolean nextPart = multipartStream.skipPreamble(); while(nextPart) { String headerSection = multipartStream.readHeaders(); String partContentType=null; String partContentName=null;
134135136137138139140141142143144
byte[] boundary = contentType.substring( contentType.indexOf("boundary=")+9).getBytes(); InputStream input = (InputStream)req.getInputStream(); MultipartStream multi = new MultipartStream(input, boundary); boolean nextPart = multi.skipPreamble(); while(nextPart) { Map headers = parseHeaders(multi.readHeaders()); String fieldName = getFieldName(headers); if (fieldName != null)
151152153154155156157158159160161