private static int removeWhiteSpace ( char [ ] data ) { if ( data == null ) { return 0 ; } // count characters that's not whitespace int newSize = 0 ; int len = data . length ; for ( int i = 0 ; i < len ; i ++ ) { if ( ! isWhiteSpace ( data [ i ] ) ) { data [ newSize ++ ] = data [ i ] ; } } return newSize ; }
remove WhiteSpace from MIME containing encoded Base64 data .