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
102 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

627 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