byte[] encodeLikeABoss(final byte[] input) {

        if (input == null) {
            throw new NullPointerException("input");
        }

        final byte[] output = new byte[input.length << 1];

        int index = 0; // index in output
        for (int i = 0; i < input.length; i++) {
            String s = Integer.toString(input[i] & 0xFF, 16);
            if (s.length() == 1) {
                s = "0" + s;
            }
            output[index++] = (byte) s.charAt(0);
            output[index++] = (byte) s.charAt(1);
        }

        return output;
    }
byte [ ] encodeLikeABoss ( final byte [ ] input ) { if ( input == null ) { throw new NullPointerException ( "input" ) ; } final byte [ ] output = new byte [ input . length << 1 ] ; int index = 0 ; for ( int i = 0 ; i < input . length ; i ++ ) { String s = Integer . toString ( input [ i ] & 0xFF , 16 ) ; if ( s . length ( ) == 1 ) { s = "0" + s ; } output [ index ++ ] = ( byte ) s . charAt ( 0 ) ; output [ index ++ ] = ( byte ) s . charAt ( 1 ) ; } return output ; }
[TESTING].

@param input octets.

@return nibbles.