Ola pessoal,
Existe alguma maneira melhor para se formatar in em HEX?
int MAX = 3; //4K
String sdtrHeaderSizeInHEX = Integer.toHexString(4000).toUpperCase();
strHeaderSizeInHEX = String.format("%1$#" + MAX + "s", strHeaderSizeInHEX).replaceAll(" ", "0");
if (strHeaderSizeInHEX.length() > MAX)
throw new Exception("Header size too large");
Quero que o valor (no maximo 4095) seja formatado em HEX (maiusculo) com 0 a esquerda e que nao ultrapasse 3 digitos.
Estou meio cansado, e por isso nao consigo ter ideais melhores...rs
Alguem poderia ajudar?
Obrigado
