public static String byteRegexToString ( final String regexp ) { final StringBuilder buf = new StringBuilder ( ) ; for ( int i = 0 ; i < regexp . length ( ) ; i ++ ) { if ( i > 0 && regexp . charAt ( i - 1 ) == ' ' ) { if ( regexp . charAt ( i - 3 ) == ' ' ) { // tagk byte [ ] tagk = new byte [ TSDB . tagk_width ( ) ] ; for ( int x = 0 ; x < TSDB . tagk_width ( ) ; x ++ ) { tagk [ x ] = ( byte ) regexp . charAt ( i + x ) ; } i += TSDB . tagk_width ( ) ; buf . append ( Arrays . toString ( tagk ) ) ; } else { // tagv byte [ ] tagv = new byte [ TSDB . tagv_width ( ) ] ; for ( int x = 0 ; x < TSDB . tagv_width ( ) ; x ++ ) { tagv [ x ] = ( byte ) regexp . charAt ( i + x ) ; } i += TSDB . tagv_width ( ) ; buf . append ( Arrays . toString ( tagv ) ) ; } } else { buf . append ( regexp . charAt ( i ) ) ; } } return buf . toString ( ) ; }
Little helper to print out the regular expression by converting the UID bytes to an array .