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 .