Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Reading Big Endian Values

Reading Big Endian Values

Scheduled Pinned Locked Moved C#
helpquestiontutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Klazen
    wrote on last edited by
    #1

    Hey, I am using a BinaryReader to read some Int16 values from a file. These values, however, are stored in big-endian format. I am sure there is a way to fix this issue programmatically, I'm just not sure how to go about doing it. So, how can I read a big-endian value from a file and get it to display correctly?

    P 1 Reply Last reply
    0
    • K Klazen

      Hey, I am using a BinaryReader to read some Int16 values from a file. These values, however, are stored in big-endian format. I am sure there is a way to fix this issue programmatically, I'm just not sure how to go about doing it. So, how can I read a big-endian value from a file and get it to display correctly?

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      Just write a function that takes the Int16 values and converts them from big-endian to little-endian.

      "Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus

      K 1 Reply Last reply
      0
      • P Paul Conrad

        Just write a function that takes the Int16 values and converts them from big-endian to little-endian.

        "Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus

        K Offline
        K Offline
        Klazen
        wrote on last edited by
        #3

        Ok, thank you. I was just wondering that perhaps there was a function already built into MS C# that would do it for me.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups