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
67 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
  • 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now