static private char[] skipWhitespacesSuffix(char[] data){
  for (int i=data.length - 1; i >= 0; i--) {
    if (!XMLChar.isSpace(data[i])) {
      if (i == data.length - 1) {
        return data;
      }
 else {
        return Arrays.copyOfRange(data,0,i + 1);
      }
    }
  }
  return new char[0];
}

static private char [ ] skipWhitespacesSuffix ( char [ ] data ) { for ( int i = data . length - 1 ; i >= 0 ; i -- ) { if ( ! XMLChar . isSpace ( data [ i ] ) ) { if ( i == data . length - 1 ) { return data ; } else { return Arrays . copyOfRange ( data , 0 , i + 1 ) ; } } } return new char [ 0 ] ; }
private method that skips whitespaces at the end of the data .
