public static String toHexString ( byte [ ] bytes , int start , int len ) { StringBuilder buf = new StringBuilder ( ) ; for ( int i = 0 ; i < len ; i ++ ) { int b = bytes [ start + i ] & 0xFF ; if ( b < 16 ) buf . append ( ' ' ) ; buf . append ( Integer . toHexString ( b ) ) ; } return buf . toString ( ) ; }
Writes some bytes in Hexadecimal format