Solved

How would you interpret the record size in an example, for the first record for a file using C#?

Posted on 2016-10-11
4
88 Views
Last Modified: 2016-10-12
I am writing a C# console application. I read a binary file. In the file there is a binary, four-byte
field that precedes each record and displays the number of positions in the record (excluding
itself) in Motorola byte order. How would you interpret the record size in this example for the first record?
The first 2 bytes after the number of positions is the Record Type which appears to be "01" (value of [4] and [5]).

var bytes = File.ReadAllBytes(filePath);  

[0]  0
[1]  0
[2]  0
[3]  38
[4]  48
[5]  49
0
Comment
Question by:zimmer9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 41839795
using C#?
So why is this in the Java TA?
0
 

Author Comment

by:zimmer9
ID: 41839913
I corrected the Topic. Thanks for pointing that out.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 41839946
Corrected now. Could have probably helped in Java though 'Motorola byte order' is not a phrase i'm familiar with ;)
0
 
LVL 16

Accepted Solution

by:
DansDadUK earned 500 total points
ID: 41840038
If the first four bytes are supposed to represent a binary value (in Motorola (= Big-Endian) byte order, then the value from your example would appear to be 38.
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question