In .net is a class used to read binary values. In general, it is a class or a program to read and manipulate binary data.
Questions tagged [binaryreader]
244 questions
0
votes
1 answer
Port BinaryReader to IEnumerator?
I have a method that reads a variable number of bytes from an IEnumerable, and stops when it finds a certain flag.
Is there an easy and efficient way to adapt a BinaryReader and make the method read only the necessary amount of bytes?
P.S. It…

Shimmy Weitzhandler
- 101,809
- 122
- 424
- 632
0
votes
2 answers
BinaryReader and while statement operators
This is not my code. I am supposed to figure out what is going on. The line of the while statement is where I am confused. Is all its trying to say is read until end of file. I don't understand how it would evaluate to some integer for comparison.…

Josh Davis
- 90
- 8
0
votes
0 answers
Use a BinaryReader on a MemoryStream in C#
I'm using a memory reader to read a file and put it in a MemoryStream. The MemoryStream is populated, and I'm trying to read with the BinaryReader because the endianness of the file change, so I use a Binary reader that can detect the…

Arimhan
- 31
- 1
- 3
0
votes
1 answer
Read binary data (image) from separated file
I have a file which has records for employees data and images. Each record for one employee and his data, his image, and his wife image. I can't change the file structure
There are separators between text data and images.
Here a sample of one…

404_File_Not_Found
- 11
- 3
0
votes
1 answer
Writing to MemoryStream from BinaryReader
i am having an issue when trying to read saved List from binary file back to a List.
the file is encrypted, without encryption i had no problem.
writing method:
private void WriteEncodedFile(FileStream fileStream, MemoryStream memoryStream)
{
…

TTomer
- 356
- 2
- 11
0
votes
1 answer
Read dictionary from dat file
I wrote Dictionary to dat file , my Dictionary look like:
Dictionary>
Now my problem is to read from file the Dictionary ,I tried to use BinaryReader and StreamReader but my Dictionary is still null.
My write…

user2915374
- 35
- 4
0
votes
1 answer
Cannot implicitly convert type 'int' to LittleEndian ByteOrder
I have a problem with my function for loading RAW images. I don't understand the reason for the error. It shows me this error:
Cannot implicitly convert type 'int' to 'Digital_Native_Image.DNI_Image.Byteorder'
public void load_DNI(string…

user2827482
- 199
- 1
- 2
- 9
0
votes
1 answer
Unable to read beyond the end of the stream is caused when use readbinary
I am trying to send a value by socket .So i have two parts in my project Client and server .
The client sends a value to server using this code :
NetworkStream networkStream = socketForServer.GetStream();
System.IO.BinaryWriter…

Ehsan Akbar
- 6,977
- 19
- 96
- 180
0
votes
2 answers
Send a value by socket and read the value by reader.ReadInt32() changes value
I am trying to send a value by socket .So i have two parts in my project Client and server .
The client sends a value to server using this code :
System.IO.BinaryWriter binaryWriter =
new System.IO.BinaryWriter(networkStream);
…

Ehsan Akbar
- 6,977
- 19
- 96
- 180
0
votes
3 answers
Byte[stream.length] - out of memory exception, best way to solve?
i am trying to read the stream of bytes from a file. However when I try to read the bytes I get a
The function evaluation was disabled because of an out of memory
exception
Quite straightforward. However, what is the best way of getting around…

user3428422
- 4,300
- 12
- 55
- 119
0
votes
2 answers
C# Binary Reader
I'm making an encryption program and need to save the encrypted password to a file using the binary reader and writer. When i try and read the data out all I get is a number. What did I do wrong?
public static string readData(string fileName)
…

user3453481
- 51
- 1
- 9
0
votes
0 answers
Fastest way to read and process pdf file in c#
I am reading pdf file into array of bytes using BinaryReader..as
byte[] filecontent ;
BinaryReader binReader = new BinaryReader(File.Open(FileName, FileMode.Open, FileAccess.Read));
binReader.BaseStream.Position = 0;
filecontent =…

user2868111
- 11
- 2
0
votes
2 answers
How to read UInt32 numbers of bytes with binary reader?
I need my code to do something like this - Somewhere in the code num gets a value and after that i want to read from file EXACTLY as bytes is the number num.
For example: If num is 39382 i need to read 39382 bytes and place them into byte[]…

Georgi
- 519
- 4
- 19
0
votes
1 answer
System.IO - Does BinaryReader/Writer read/write exactly what a file contains? (abstract concept)
I'm relatively new to C# and am attempting to adapt a text encryption algorithm I designed in wxMaxima into a Binary encryption program in C# using Visual Studio forms. Because I am new to reading/writing binary files, I am lacking in knowledge…

ThisHandleNotInUse
- 1,135
- 1
- 10
- 23
0
votes
2 answers
How can you read for a specific value from a binary file starting from the end of the file?
I am trying to figure out how to actually (appropriately) read for the PDF trailer Byte_offset_of_last_cross-reference_section from a PDF file.
According to the PDF 1.7 (ISO 32000-1:2008) specification, the file structure is designed in a way that…

myermian
- 31,823
- 24
- 123
- 215