How do I read a binary file in C#?

Posted by tomcamara on Stack Overflow See other posts from Stack Overflow or by tomcamara
Published on 2011-01-05T12:19:07Z Indexed on 2011/01/05 15:54 UTC
Read the original article Hit count: 157

Filed under:
|
|

I have a file that exists within a text and a binary image, I need to read from 0 to 30 position the text in question, and the position on 31 would be the image in binary format. What are the steps that I have to follow to proceed with that problem?

Currently, I am trying to read it using FileStream, and then I move the FileStream var to one BinaryReader as shown below:

FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read)
BinaryReader br = new BinaryReader(fs)

From there forward, I'm lost.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET