Questions tagged [binarywriter]

170 questions
0
votes
0 answers

BinaryWriter is giving a bad size

short[,] out2 = new short[1201, 1201]; FileStream fs = new FileStream(Application.StartupPath + "\\One_File\\result.hgt", FileMode.OpenOrCreate, FileAccess.Write); BinaryWriter bw = new…
cybergogic
  • 33
  • 1
  • 6
0
votes
0 answers

Response.BinaryWrite() causing file corruption

When writing a file to the HttpResponse the file is being corrupted. The file(s) I'm writing are saved to disc prior to writing. I've tested that the generated/saved file is fine, it's only when writing to the response. I've tested using multiple…
orlando15767
  • 145
  • 1
  • 2
  • 15
0
votes
0 answers

Edit values in the 16gb .bin file

I have a 16gb data file, what I need is edit some bytes at the specific binary address of the file. I'm curious is it possible to accomplish or not, because of the huge size of the file, as I understand BinaryWriter class will open this file first…
James_BK
  • 21
  • 1
  • 7
0
votes
1 answer

Save the received MJPEG data in a .mjpeg file with C#

I have a project. It is with Raspberry Pi Camera V2. One PC is used for encoding the captured video in MJPEG format and sending it with the serial port. My PC is used for receiving the data, saving it in a .mjpeg formatted file and playing it with…
Kane Loey
  • 5
  • 4
0
votes
2 answers

How to write Binary and ASCII to the same txt-file in c#?

as you can imagine I'm adressing my question to you as I wasn't able to solve my problem doing research. Also I'm rather unexperienced so maybe you can help. At work I have a simulation program that produces huge amount of data so I want to write…
0
votes
1 answer

How to use BinaryWriter to write double value?

I have two applications that needs to pass value to each other in a fast way, and some value needs to be kept(when I restart my computer it still exist), so I need to create a file, now I know how to do with int: using (BinaryWriter writer = new…
DaveG
  • 491
  • 1
  • 6
  • 19
0
votes
1 answer

C# file send, stream problem

I have a server and a client. Server sends an executable and an input.txt to the client. Client should execute it and send output to the server but I have a problem. When I try to run executable it gives an error about argument format. After that I…
aykut
  • 563
  • 2
  • 6
  • 18
0
votes
2 answers

c# Serialport data received event handler

I am currently reading data from serialport using WPF. I am able to read data from serialport & write it in File using Binarywriter. What Problem I am facing right now is: I want to Analyse this data. I have developed one function which contains Use…
0
votes
1 answer

Saving WPF Button Properties using BinaryWriter

Is it possible to do? I am having trouble with finding a way of saving WPF Button's properties using BinaryWriter for a text-based game. The thing is I need it to save button's button1.Content, button1.Click and button1.ToolTip so I can load it back…
Zephylir
  • 27
  • 9
0
votes
0 answers

Seeking in my MemoryStream is having undesired results

I am working on re-writing our encryption class to be FIPS compliant, and in doing so have to re-work how we're handling non-secret payload data. At the moment, I'm writing out the size of my non-secret payload, then writing the size of my IV. I…
Johnathon Sullinger
  • 7,097
  • 5
  • 37
  • 102
0
votes
1 answer

BinaryReader and BinaryWriter for dynamic short array

I've made a tool that I made to encrypt and decrypt messages. Not that I'm working for the military or anything, I just got interested in a concept. It takes each character and converts it to my personal binary format. Each character is extended to…
Corey Iles
  • 155
  • 1
  • 17
0
votes
2 answers

File Copy Program Doesn't Properly Copy File

Hello I've been working on terminal-like application to get better at programming in c#, just something to help me learn. I've decided to add a feature that will copy a file exactly as it is, to a new file... It seems to work almost perfect. When…
Corderro Artz
  • 41
  • 1
  • 6
0
votes
1 answer

Writing to file, memory used steadily increasing

I have an application where I need to write binary to a file constantly. The bits of data are small, about 1K each. The computers this is running on aren't great and are running XP. I've run into the problem that when I turn on the logging the…
eddie_cat
  • 2,527
  • 4
  • 25
  • 43
0
votes
1 answer

Why write to BinaryWriter twice?

I'm implementing this tone-generator program and it works great: https://social.msdn.microsoft.com/Forums/vstudio/en-US/c2b953b6-3c85-4eda-a478-080bae781319/beep-beep?forum=vbgeneral What I can't figure out, is why the following two lines of…
swabygw
  • 813
  • 1
  • 10
  • 22
0
votes
1 answer

Method for "adding" new data to current open file C#

I am writing a program where I have 2 listboxes with the same data but the one listbox items are update with the student name and their TOTAL score and the other with the student name and each individual judge score next to the student name.…