Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
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
Medium Priority
?
112 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

715 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