Ver Mensaje Individual
  #3 (permalink)  
Antiguo 17/11/2014, 08:59
Avatar de Profesor_Falken
Profesor_Falken
 
Fecha de Ingreso: agosto-2014
Ubicación: Mountain View
Mensajes: 1.323
Antigüedad: 9 años, 8 meses
Puntos: 182
Respuesta: Formar cifra Hexadecimal a partir de varios bytes

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
__________________
If to err is human, then programmers are the most human of us