Skip to main content
0 votes
1 answer
61 views

Does accessing the 'Length' and 'Position' properties of a Stream have a significant impact on performance?

// Case 1 while(true) { int packetLength = GetPacketLength(); byte[] data = br.ReadBytes(packetLength); if(data.length < packetLength) { Console.Write("end"); ...
seonguk.jeon's user avatar
0 votes
0 answers
133 views

asp classic BinaryRead with hebrew charachters has wrong encoding

I am using the "shadowupload.asp" library to handle an upload of a file from a form. Using asp classic & vbscript. some form field values are in hebrew and there is some encoding issue ...
Noam Smadja's user avatar
  • 1,037
0 votes
0 answers
52 views

Why does binary reader put all the content of my 2d array into a single array row?

I am trying to use binary writer/reader to serialize and deserialize a 2D array, this is the code I am using for this: public class Connect4BoardData : ASerializable { public int[,] board = new ...
Dinnea's user avatar
  • 13
0 votes
0 answers
132 views

How to read a stream of bytes when you already know the structure of the bytes in C#?

I am attempting to parse a .blend (Blender 3D Modelling Program Save File) in C#. .blend follows a TLV pattern and using 3rd party tools I've managed to extract the majority of the data: .blend File ...
Simon Nordon's user avatar
0 votes
3 answers
2k views

C# BinaryReader end of Stream

I am wondering if it's a good practice to use the EndOfStreamException to detect the end of the BinaryReader stream> I don't want to use BaseStream.Length property or PeekChar as proposed here C# ...
Elias Ghali's user avatar
1 vote
0 answers
37 views

BinaryReader returning very large doubles. What type of value should I be returning?

I'm trying to read a binaryfile. I don't know the structure, but I do have some code written in R that can read it. I'm not familiar with R but have made some progress converting it to C# and struggle ...
Richard's user avatar
  • 559
0 votes
0 answers
70 views

Why I am not able to get the data back which I have saved to dat file using BinaryReader in C#? How to Implement this properly using BinaryReader?

I have created a Class with constructor in which I pass the parameters as studentName, studentMarks & avgMarks and use Constructor to set the values and inside WriteData() method I use ...
Swapnil Nawale's user avatar
3 votes
2 answers
2k views

Can't read data correctly with BinaryReader from WebRequest

Hy! I'm developing a C# SOAP service to communicate with one of our governmental services. They also use SOAP for communication, but now they introduced two new endpoints that handle requests very ...
Balázs Varga's user avatar
0 votes
1 answer
336 views

Process and delete lines from file, stop if CancellationToken is send

I have to process the lines of a file that contain path and status information and start an upload operation for the line/path. In some cases the upload might fail, so that I have to keep the line, in ...
becky's user avatar
  • 351
0 votes
0 answers
228 views

Slow ReadLine by `\n` on BinaryReader

I am using a BinaryReader to read a file and split by new line \n into ReadOnlySpan<byte> (to add context I want bytes and not strings as I am using Utf8JsonReader and trying to avoid copying ...
morleyc's user avatar
  • 2,481
0 votes
0 answers
92 views

Is there any way to read information stored in binary (.bin) file?

I have a binary (.bin) file, I have opened it on Olly dB but wanted to read it but failed. please help me out to resolve the issue.
Sohail Ahmed's user avatar
0 votes
1 answer
238 views

How to read whole binary file (not only the first variables) including string, long and int

using (var fileStream = new FileStream("data.bin", FileMode.Append, FileAccess.Write)) using (var bw1 = new BinaryWriter(fileStream)) { bw1.Write(jmeno); bw1.Write(date); bw1....
Kryštof Dušek's user avatar
0 votes
1 answer
69 views

(VB.NET) How to read binary file (not like 00 C8 but rather 51200) - Automotive Chip Tuning Software

I own a Chip Tuning shop in Serbia. I'm developing some software that will make our lives easier in our line of business. I couldn't seem to find a way to create a binary reader that will display both ...
asvarga's user avatar
0 votes
1 answer
524 views

Is it possible to detect if BinaryReader.ReadBytes(int) reaches the end of a stream?

Most of BinaryReader's read methods throw an EndOfStreamException if it reaches the end of a stream, but strangely the ReadBytes method doesn't. But what if I do still want to throw an ...
JochCool's user avatar
0 votes
0 answers
229 views

Binaryreader Readint32() returns too big value or -ve value

I am working on client server application where server sends screen image to client using UDT ptotocol. below is my code server sends image using binary-writer and client receive data using binary-...
try test's user avatar

15 30 50 per page
1
2 3 4 5
17