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. binary file reading and converting

binary file reading and converting

Scheduled Pinned Locked Moved C#
java
1 Posts 1 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.
  • B Offline
    B Offline
    bwagz
    wrote on last edited by
    #1

    Hi, So I was given this data file, which i think is in binary format and i have to extract data from it starting at an offset of 1000. I tried opening the file in Wordpad and really have no clue how its encoded. I was able to mimic the way it was displayed in wordpad using a streamreader with a text encoding of utf7 then writing it to the console. Each value I'm trying to extract consists of 2 bytes and I have to convert this into a positive/negative integer. I tried many ways of doing this but was unable to get the right result. I noticed first of all, that the values i'm getting largely consist of zeros and all positives which is way wrong. The whole idea of binary files are so foreign to me and i have no clue where to begin on this. I really wish they had started us on C in school rather than java...:sigh: thanks in advance

    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