StringBuffer s = new StringBuffer();  for (int i = 0; i < length; i++) { String sHex = Integer.toHexString((int) (data[i] & 0xFF)); s.append(((sHex.length() == 1) ? "0" : "") + sHex+" "); s.append((i % 20 == 19) ? "\n" : "");
StringBuffer s = new StringBuffer();  for (int i = 0; i < length; i++) { String sHex = Integer.toHexString((int) (data[i] & 0xFF)); s.append(((sHex.length() == 1) ? "0" : "") + sHex+" "); s.append((i % 20 == 19) ? "\n" : ""); } return s.toString();
  String hexDump(byte []data,int length){    StringBuffer s = new StringBuffer();      for (int i = 0; i < length; i++) {      String sHex = Integer.toHexString((int) (data[i] & 0xFF));      s.append(((sHex.length() == 1) ? "0" : "") + sHex+" ");        s.append((i % 20 == 19) ? "\n" : "");    }  return s.toString();  }