Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

BinaryReader.ReadInt32 bug

Discussion in 'WebGL' started by fullike, Mar 31, 2015.

  1. fullike

    fullike

    Joined:
    Nov 13, 2012
    Posts:
    17
    I use BinaryReader and BinaryWriter to serialize data and find that a signed integer values -1 become 255 after BinaryReader.ReadInt32, please check this.

    Thanks
     
  2. GabrieleUnity

    GabrieleUnity

    Unity Technologies

    Joined:
    Sep 4, 2012
    Posts:
    116
    Hello,

    would you mind filing a bug? It will make it easier to make sure the bug gets processed and fixed ASAP. I'm taking a note of the issue anyway, but having a case number will surely speed up the process ;)

    Thanks,
    Gabriele
     
  3. gfoot

    gfoot

    Joined:
    Jan 5, 2011
    Posts:
    550
    I'm pretty sure this too was fixed in 5.0.0p1, and was due to BinaryReader using bitshifts internally, which were broken in 5.0.0f4.
     
  4. GabrieleUnity

    GabrieleUnity

    Unity Technologies

    Joined:
    Sep 4, 2012
    Posts:
    116
    I gave it a try and it seems to be working fine on the last Unity version.

    Gabriele
     
  5. fullike

    fullike

    Joined:
    Nov 13, 2012
    Posts:
    17
    Thank you guys, i will try the lastest release :)