@SuppressWarnings("NarrowingCompoundAssignment")
  private String hexAV() {
    if (pos + 4 >= length) {
      // encoded byte array  must be not less then 4 c
      throw new IllegalStateException("Unexpected end of DN: " + dn);
    }

    beg = pos; // store '#' position
    pos++;
    while (true) {

      // check for end of attribute value
      // looks for space and component separators
      if (pos == length || chars[pos] == '+' || chars[pos] == ','
          || chars[pos] == ';') {
        end = pos;
        break;
      }

      if (chars[pos] == ' ') {
        end = pos;
        pos++;
        // skip trailing space chars before comma or semicolon.
        // (compatibility with RFC 1779)
        for (; pos < length && chars[pos] == ' '; pos++) {
        }
        break;
      } else if (chars[pos] >= 'A' && chars[pos] <= 'F') {
        chars[pos] += 32; //to low case
      }

      pos++;
    }

    // verify length of hex string
    // encoded byte array  must be not less then 4 and must be even number
    int hexLen = end - beg; // skip first '#' char
    if (hexLen < 5 || (hexLen & 1) == 0) {
      throw new IllegalStateException("Unexpected end of DN: " + dn);
    }

    // get byte encoding from string representation
    byte[] encoded = new byte[hexLen / 2];
    for (int i = 0, p = beg + 1; i < encoded.length; p += 2, i++) {
      encoded[i] = (byte) getByte(p);
    }

    return new String(chars, beg, hexLen);
  }
@ SuppressWarnings ( "NarrowingCompoundAssignment" ) private String hexAV ( ) { if ( pos + 4 >= length ) { throw new IllegalStateException ( "Unexpected end of DN: " + dn ) ; } beg = pos ; pos ++ ; while ( true ) { if ( pos == length || chars [ pos ] == '+' || chars [ pos ] == ',' || chars [ pos ] == ';' ) { end = pos ; break ; } if ( chars [ pos ] == ' ' ) { end = pos ; pos ++ ; for ( ; pos < length && chars [ pos ] == ' ' ; pos ++ ) { } break ; } else if ( chars [ pos ] >= 'A' && chars [ pos ] <= 'F' ) { chars [ pos ] += 32 ; } pos ++ ; } int hexLen = end - beg ; if ( hexLen < 5 || ( hexLen & 1 ) == 0 ) { throw new IllegalStateException ( "Unexpected end of DN: " + dn ) ; } byte [ ] encoded = new byte [ hexLen / 2 ] ; for ( int i = 0 , p = beg + 1 ; i < encoded . length ; p += 2 , i ++ ) { encoded [ i ] = ( byte ) getByte ( p ) ; } return new String ( chars , beg , hexLen ) ; }
gets hex string attribute value: "#" hexstring