public static String byteArrayToHexString(byte in[],int offset){
  if (in == null || in.length <= 0 || offset >= in.length)   return null;
  StringBuffer out=new StringBuffer(in.length * 3);
  for (int i=offset; i < in.length; i++) {
    out.append(byteToHexString(in[i]));
    out.append(' ');
  }
  return out.toString();
}

public static String byteArrayToHexString ( byte in [ ] , int offset ) { if ( in == null || in . length <= 0 || offset >= in . length ) return null ; StringBuffer out = new StringBuffer ( in . length * 3 ) ; for ( int i = offset ; i < in . length ; i ++ ) { out . append ( byteToHexString ( in [ i ] ) ) ; out . append ( ' ' ) ; } return out . toString ( ) ; }
converts the given byte array into a readable hexa - decimal formatted string , starting from given offset < br > this code was originally taken from jeff boyle ' s article on devx . com
