public String getasByte(int var, int num)
    {
        try
        {
        if(num == 2){
            int b1 = var & 0xff;
            int b2 = (var >> 8) & 0xff;
            byte[] varbyte = {(byte)b1, (byte)b2};
            return new String(varbyte,"ISO8859-1");

        } else if(num == 4){
            int b1 = var & 0xff;
            int b2 = (var >> 8) & 0xff;
            int b3 = (var >> 16) & 0xff;
            int b4 = (var >> 24) & 0xff;
            byte[] varbyte = {(byte)b1, (byte)b2, (byte)b3, (byte)b4};
            return new String(varbyte,"ISO8859-1");
        }
        } catch (Exception e)
        {
        }
        return null;

    }