Click here to Skip to main content
15,896,557 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Questions about reading binary files Pin
GentooGuy29-Sep-07 8:52
GentooGuy29-Sep-07 8:52 
GeneralRe: Questions about reading binary files Pin
Luc Pattyn29-Sep-07 9:15
sitebuilderLuc Pattyn29-Sep-07 9:15 
GeneralRe: Questions about reading binary files Pin
GentooGuy29-Sep-07 9:20
GentooGuy29-Sep-07 9:20 
GeneralRe: Questions about reading binary files Pin
Mark Salsbery29-Sep-07 9:16
Mark Salsbery29-Sep-07 9:16 
GeneralRe: Questions about reading binary files Pin
GentooGuy29-Sep-07 9:20
GentooGuy29-Sep-07 9:20 
GeneralRe: Questions about reading binary files Pin
GentooGuy29-Sep-07 10:27
GentooGuy29-Sep-07 10:27 
GeneralRe: Questions about reading binary files Pin
GentooGuy29-Sep-07 10:52
GentooGuy29-Sep-07 10:52 
GeneralRe: Questions about reading binary files [modified*2] Pin
Mark Salsbery29-Sep-07 11:08
Mark Salsbery29-Sep-07 11:08 
I think we're confusing two different issues here...

First, your "od" is lumping 2 byte pairs and is assuming little-endian
byte order so, as you can see from the sample listings you've posted,
each pair of bytes appears swapped in the od-generated listing.

Second, you have to parse your file properly, depending on the byte order.
exif has some kind of tag to indicate whether multi-byte integers are stored
in "motorola" or "intel" order.  This doesn't mean you can just go through the
entire file and swap every pair of bytes.  This means when you encounter
multibyte-integer data in the file, you may need to swap bytes to work with
the data on your platform.

You need to parse the file bytes following its type and format.  I don't have the jpeg/jfif
format memorized but it's well documented all over the internet Smile | :)

Again, the only swapping going on here is by your "od" utility.  In your code you simply
have the bytes in the same order they occur in the file.

Mark

*edit*  LOL I really meant "sample", not "ample"....ample sounded snotty LMAO


Last modified: 17mins after originally posted --


Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Questions about reading binary files [modified*2] Pin
GentooGuy30-Sep-07 2:40
GentooGuy30-Sep-07 2:40 
GeneralRe: Questions about reading binary files Pin
Mark Salsbery30-Sep-07 6:31
Mark Salsbery30-Sep-07 6:31 
GeneralRe: Questions about reading binary files Pin
GentooGuy30-Sep-07 6:37
GentooGuy30-Sep-07 6:37 
GeneralRe: Questions about reading binary files Pin
Mark Salsbery30-Sep-07 6:47
Mark Salsbery30-Sep-07 6:47 
GeneralRe: Questions about reading binary files Pin
GentooGuy30-Sep-07 6:55
GentooGuy30-Sep-07 6:55 
GeneralRe: Questions about reading binary files Pin
Mark Salsbery30-Sep-07 7:10
Mark Salsbery30-Sep-07 7:10 
GeneralRe: Questions about reading binary files Pin
GentooGuy30-Sep-07 14:51
GentooGuy30-Sep-07 14:51 
GeneralRe: Questions about reading binary files Pin
Mark Salsbery29-Sep-07 11:11
Mark Salsbery29-Sep-07 11:11 
GeneralRe: Questions about reading binary files Pin
Mark Salsbery29-Sep-07 11:22
Mark Salsbery29-Sep-07 11:22 
GeneralRe: Questions about reading binary files Pin
Luc Pattyn29-Sep-07 11:49
sitebuilderLuc Pattyn29-Sep-07 11:49 
AnswerRe: Questions about reading binary files Pin
Luc Pattyn30-Sep-07 4:31
sitebuilderLuc Pattyn30-Sep-07 4:31 
QuestionC++ Byte Level Code.. [modified] Pin
spalanivel27-Sep-07 21:26
spalanivel27-Sep-07 21:26 
AnswerRe: C++ Byte Level Code.. Pin
led mike28-Sep-07 5:19
led mike28-Sep-07 5:19 
GeneralRe: C++ Byte Level Code.. Pin
spalanivel2-Oct-07 5:24
spalanivel2-Oct-07 5:24 
QuestionSimple ESC Key Pin
Michael10127-Sep-07 18:18
Michael10127-Sep-07 18:18 
AnswerRe: Simple ESC Key Pin
Luc Pattyn28-Sep-07 7:44
sitebuilderLuc Pattyn28-Sep-07 7:44 
QuestionAnother DataGridView Question Pin
BuckBrown27-Sep-07 11:37
BuckBrown27-Sep-07 11:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.