Home | History | Annotate | Download | only in multipart

Lines Matching refs:parts

351      * Write all parts and the last boundary to the specified output stream.
354 * @param parts The parts to write.
356 * @throws IOException If an I/O error occurs while writing the parts.
358 public static void sendParts(OutputStream out, final Part[] parts)
360 sendParts(out, parts, DEFAULT_BOUNDARY_BYTES);
364 * Write all parts and the last boundary to the specified output stream.
367 * @param parts The parts to write.
370 * @throws IOException If an I/O error occurs while writing the parts.
374 public static void sendParts(OutputStream out, Part[] parts, byte[] partBoundary)
377 if (parts == null) {
378 throw new IllegalArgumentException("Parts may not be null");
383 for (int i = 0; i < parts.length; i++) {
385 parts[i].setPartBoundary(partBoundary);
386 parts[i].send(out);
395 * Return the total sum of all parts and that of the last boundary
397 * @param parts The parts.
400 * @throws IOException If an I/O error occurs while writing the parts.
402 public static long getLengthOfParts(Part[] parts)
404 return getLengthOfParts(parts, DEFAULT_BOUNDARY_BYTES);
408 * Gets the length of the multipart message including the given parts.
410 * @param parts The parts.
414 * @throws IOException If an I/O error occurs while writing the parts.
418 public static long getLengthOfParts(Part[] parts, byte[] partBoundary) throws IOException {
419 LOG.trace("getLengthOfParts(Parts[])");
420 if (parts == null) {
421 throw new IllegalArgumentException("Parts may not be null");
424 for (int i = 0; i < parts.length; i++) {
426 parts[i].setPartBoundary(partBoundary);
427 long l = parts[i].length();