net/src/main/java/com/stanfy/enroscar/rest/request/net/multipart/Part.java
public static void sendParts(final OutputStream out, final Part[] parts, final byte[] partBoundary)
  throws IOException {

    if (parts == null) {
      throw new IllegalArgumentException("Parts may not be null");
    }
    if (partBoundary == null || partBoundary.length == 0) {
      throw new IllegalArgumentException("partBoundary may not be empty");
    }
    for (int i = 0; i < parts.length; i++) {
      // set the part boundary before the part is sent
      parts[i].setPartBoundary(partBoundary);
      parts[i].send(out);
    }
    out.write(EXTRA_BYTES);
    out.write(partBoundary);
    out.write(EXTRA_BYTES);
    out.write(CRLF_BYTES);
  }
public static void sendParts(final OutputStream out, final Part[] parts, final byte[] partBoundary)
  throws IOException {

    if (parts == null) {
      throw new IllegalArgumentException("Parts may not be null");
    }
    if (partBoundary == null || partBoundary.length == 0) {
      throw new IllegalArgumentException("partBoundary may not be empty");
    }
    for (int i = 0; i < parts.length; i++) {
      // set the part boundary before the part is sent
      parts[i].setPartBoundary(partBoundary);
      parts[i].send(out);
    }
    out.write(EXTRA_BYTES);
    out.write(partBoundary);
    out.write(EXTRA_BYTES);
    out.write(CRLF_BYTES);
  }
Write all parts and the last boundary to the specified output stream.

@param out The stream to write to.
@param parts The parts to write.
@param partBoundary The ASCII bytes to use as the part boundary.

@throws IOException If an I/O error occurs while writing the parts.

@since 3.0