243 questions
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");
...
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 ...
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 ...
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 ...
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# ...
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 ...
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 ...
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 ...
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 ...
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 ...
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.
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....
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 ...
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 ...
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-...