package com.eactive.eai.util; public class HexaConverter { public static final String bytesToHexa(byte[] abyte) { StringBuilder s = new StringBuilder(); if (abyte == null) return s.toString(); for (int i = 0; i < abyte.length; i++) { s.append( Integer.toHexString((abyte[i] & 0xf0) >> 4) ) .append( Integer.toHexString(abyte[i] & 0xf)); } return s.toString(); } public static final byte[] hexaToBytes(String hexa) { if((hexa.length() % 2) != 0) return null; byte[] bytes = new byte[hexa.length() / 2]; String hexaBytes = null; for(int i=0; i