Results 1 to 2 of 2

Thread: Converting Little Endian to Big Endian

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    3

    Converting Little Endian to Big Endian

    Hello

    I'm reading in a series of 4 byte single precision numbers using the BinaryReader. The problem is that these numbers are really big endian but are being read in as little endian. Is there a convenient way around this problem?

  2. #2

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    3
    I have solved the problem. What I have done is read in four bytes into an array using ReadByte from BinaryReader, writes those four bytes in reverse order to a second file using Write from BinaryWriter, and read in the desired value from the second file using ReadSingle from BinaryReader. It seems so simple now. Thank you all who have read my thread.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width