public int getInt(int bytec)
    {
        try
        {

        String thestring = this.packet.substring(0, bytec);
        String hex_data_s = "";
        for(int i = bytec-1; i >=0; i--){

        int data = thestring.getBytes("ISO8859-1")[i];
        if(data<0){
            data += 256;
        }
        String hex_data = Integer.toHexString(data);
        if (hex_data.length()==1)
        {
            hex_data_s += "0"+hex_data;
        } else {
            hex_data_s += hex_data;
        }
        }
        this.packet = this.packet.substring(bytec);
        return Integer.parseInt(hex_data_s,16);

        } catch (Exception e){

        }
        return 0;
    }