Go Premium for a chance to win a PS4. Enter to Win

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
?
113 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 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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 article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

971 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