does anyone know how to convert the data type "word" into a java "int".
                
            byte[] b; //Contains whatever data, one short consists of two bytes
short s = (short) (b[0] << 8 | b[1]);
public static int wordBytesToInt(byte[] bytes, int offset) {
    return (char)(bytes[offset] << 8 | bytes[offset + 1]);
}
 )
char VerifyID = (char)(decodePacket[19] << 8 | decodePacket[20]);
int i = (int)VerifyID;  
message[4]=(byte)((i & 0xff000000)>>>24); 
message[5]=(byte)((i & 0x00ff0000)>>>16); 
message[6]=(byte)((i & 0x0000ff00)>>>8);  
message[7]=(byte)((i & 0x000000ff));
    public REN(byte [] decodePacket)
    {                
        /*********************REN**********************/      
        String id = new String(decodePacket, 0, 3).trim();
        System.out.println("Id: "+id);          
        
        /*********************Sp0**********************/ 
        int Sp0 = Integer.parseInt("" +decodePacket[4]);
        System.out.println("Sp0: "+Sp0);        
        
        /*********************Sp1**********************/ 
        int Sp1 = Integer.parseInt("" +decodePacket[5]);
        System.out.println("Sp1: "+Sp1); 
        
        /*****************InSimVer********************/      
        char Ver = (char)(decodePacket[6] << 8 | decodePacket[7]);
        System.out.println("VerifyId: "+(int)Ver);  
        
        //send verification
        [B]new InSimPack((byte)'A',(byte)'C',(byte)'K',(int)Ver);[/B]
    }
    public InSimPack(byte a, byte b, byte c, int i)
    {    
        byte [] message = new byte [8];
        message[0] = (byte)a;
        message[1] = (byte)b;
        message[2] = (byte)c;
        message[3] = 0x00;
        
        //value
        message[4]=(byte)((i & 0xff000000)>>>24);
        message[5]=(byte)((i & 0x00ff0000)>>>16); 
        message[6]=(byte)((i & 0x0000ff00)>>>8);  
        message[7]=(byte)((i & 0x000000ff)); 
          LFSInit.Com.sendPacket(message, message.length);
    }
 ), but in the absense of any other replies...
public static int bytesToInt(byte[] bytes, int offset, int length) {
    int temp = 0;
    
    for (int i = 0; i < length; i++) {
        int shift = (3 - i) * 8;
        temp += (bytes[i + offset] & 0xFF) << shift;
    }
    
    return temp;
}
public static byte[] intToBytes(int value) {
    byte[] bytes = new byte[4];
    for(int i = 0; i < bytes.length; i++) {
        int offset = (bytes.length - 1 - i) * 8;
        bytes[i] = (byte)(value & (0xFF << offset) >>> offset);
    }
    
    return bytes;
}


