Ver Mensaje Individual
  #4 (permalink)  
Antiguo 17/11/2014, 10:19
corei7
 
Fecha de Ingreso: febrero-2013
Mensajes: 119
Antigüedad: 11 años, 1 mes
Puntos: 2
Respuesta: Formar cifra Hexadecimal a partir de varios bytes

Cita:
Iniciado por Profesor_Falken Ver Mensaje
Código Java:
Ver original
  1. public static void main(String[] args) {
  2.         byte b1 = 0x57;
  3.         byte b2 = 0x4F;
  4.         byte b3 = 0x05;
  5.         byte b4 = 0x11;
  6.        
  7.         int test2 = (b1 << 24) | (b2 << 16) | (b3 << 8) | b4;
  8.        
  9.         System.out.println(Integer.toHexString(test2));
  10.     }


Un saludo
Me ha servido, muchas gracias! era lo que buscaba.