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
How to binary read 7z archive
I need help for reading the number of files in the archive and their properties (weight, date etc). SDK can not be used. Only binary reading.

user2812404
- 101
- 3
0
votes
1 answer
BinaryReader throws NullReferenceException when being disposed
I have a class MyClass that needs data from a file that will be used throughout the run of the program. To read in the data I have another class OpenFileService that derives from IDisposable and uses a BinaryReader to read in all the data:
internal…

philkark
- 2,417
- 7
- 38
- 59
0
votes
3 answers
Read and write in c#
I want to read a file(image) and another file video in c# and save(write) all the contents of both files(1 after another) in single txt file.Now i want to again retrieve the first image file content and second file content separately. Is it possible…

Rathindra Singha
- 19
- 3
0
votes
2 answers
NetworkStream a thing i don´t understand in my code
I got help in a previous question on how to send an image.
The thing done was to first send the lenght of the image(size), and then the actual image, then it would know when it was done.
IT looks like this:
BinaryWriter writer = new…

Zerowalker
- 761
- 2
- 8
- 27
0
votes
3 answers
BinaryReader.ReadBytes returning junk when converted to string
if I try to explain why I need to do what I'm trying to do it will take a long time, but basically it's this: I have FileUpload control for the user to choose a Jpeg file, I make the upload and after it I want to convert that file to bytes and use…

Thiago Ruiz
- 162
- 2
- 13
0
votes
1 answer
C# BinaryReader notably slower. Alternative?
For my project I need to write UInt16, UInt32, Bytes and Strings from a file. I started with a simple class I wrote like this:
public FileReader(string path) //constructor
{
if (!System.IO.File.Exists(path))
throw new…

Adura
- 27
- 4
0
votes
1 answer
How does changing the position of the BaseStream of a BinaryReader affect the current state of a BinaryWriter that uses the same BaseStream?
I am working on a parser that watches a stream (probably from a NetworkStream). When certain data is seen on the source stream, a new MemoryStream is created and the relevant data from the source is written to it.
Then I pass the MemoryStream for…

Rich Shealer
- 3,362
- 1
- 34
- 59
0
votes
1 answer
Strange problem when trying to read data
When I write:
var tagType = _reader.ReadByte();
while (tagType != 8)
{
var skip = ReadNext3Bytes() + 11;
_reader.BaseStream.Position += skip;
tagType = _reader.ReadByte();
}
...it's working, but when I write:
var tagType =…

Alon Gubkin
- 56,458
- 54
- 195
- 288
0
votes
2 answers
C# Binary reading incomplete strings
i was hoping to get some help on this problem, so as you can see in the picture bellow, i can't seem to read the whole word up to 0x00:
what i am trying ot do, is to just read the file strings properly ,here is the code i used to open the file:
…

Omarrrio
- 1,075
- 1
- 16
- 34
0
votes
1 answer
Delphi Prism: Reading a string from binary file returns with wierd characters
I am writing a string into a file and reading it back out using binarywriter and binaryreader. When the string is read back out, it looks all funny and very long. I don't know why it is doing that.
Here is how I write into a file with…

ThN
- 3,235
- 3
- 57
- 115
0
votes
0 answers
Calculate MD5 hash from bufferd stream (BinaryReader and using buffer)
I need to calculate a MD5 hash from a bufferd stream (BinaryReader).
I can calculate the MD5 hash for the buffer (bytes), but how to calculate the MD5 hash for the complete stream ?
Can't load whole data into memory !

John Doe
- 9,843
- 13
- 42
- 73
0
votes
1 answer
BinaryReader reading different length of data depending on BufferSize
The issue is as follows, I am using an HttpWebRequest to request some online data from dmo.gov.uk. The response I am reading using a BinaryReader and writing to a MemoryStream. I have packaged the code being used into a simple test method:
public…

Jamiec
- 133,658
- 13
- 134
- 193
0
votes
1 answer
BinaryReader.ReadByte() doesn't TimedOut
I have an internet stream and I am creating reader from that
var reader = new BinaryReader(stream);
and after that I am reading bytes for searching "sync word"
if (reader.ReadByte() != magic[i++])
But sometimes i have a problem with ReadByte(). I…

Roman Golenok
- 1,427
- 9
- 26
0
votes
0 answers
Retaining a negative zero through a DataGrid
I'm using BinaryReader to read some floats off of a file and put them in a DataGrid. I saved the file back using the data that I got in the DataGrid without making any changes, and when doing a binary compare of the original and the saved files, I…

Lefteris Aslanoglou
- 177
- 1
- 13
0
votes
1 answer
Inconsistency in file before and after upload to Oracle DB
I'm trying to get my website to allow users to upload various files (HttpPostedFile), which are then stored in an Oracle database as BLOBs. Here's what I've got so far:
public static bool insertFile(int pid, HttpPostedFile file, string…

Kay Ell
- 155
- 1
- 1
- 4