public static String encodeX ( byte [ ] a ) { // check input if ( a == null || a . length == 0 ) { return "X''" ; } char [ ] out = new char [ a . length * 2 + 3 ] ; int i = 2 ; for ( int j = 0 ; j < a . length ; j ++ ) { out [ i ++ ] = xdigits [ ( a [ j ] >> 4 ) & 0x0F ] ; out [ i ++ ] = xdigits [ a [ j ] & 0x0F ] ; } out [ 0 ] = ' ' ; out [ 1 ] = ' ' ; out [ i ] = ' ' ; return new String ( out ) ; }
Encodes the given byte array into SQLite3 blob notation ie X ..