Questions tagged [binarywriter]
170 questions
0
votes
1 answer
C# binary writing return bigger file
im having a little trouble with a binary writer issue, my program is set to load SHIFT-JIS characters, and write in the same encoding, but it returns a file bigger in size :s although i remove several Characters, here is a sample of the files before…

Omarrrio
- 1,075
- 1
- 16
- 34
0
votes
1 answer
Byte array written to isolated storage area file in C# Windows Phone 7 app is invalid
I have a C# Windows Phone 7.1 app that downloads a PDF file from a foreign web server and then (tries) to save it to the isolated storage area as a file. I have tried several different ways to get this done, but the file always ends up about 30%…

Robert Oschler
- 14,153
- 18
- 94
- 227
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
2 answers
keep writing at the end of file after re opening it
[in C#]If i keep the file open, I ncan write multiples input and it saves it but if i close it, re-open it and start to write again, it starts from the beggining and overwirte everything. I tryed to open it using FileMode.Append and to do a…

ESD
- 675
- 2
- 12
- 35
0
votes
2 answers
VB.net BinaryWriter Problem
In c# i could do it like:
send.Write((ushort)9);
"send" is an instance of BinaryWriter, how can i do it in vb.net ? I've tried it like:
send.Write((UShort)9)
but i get "UShort is a type and cannot be used as an expression"
Thanks!
holyone
0
votes
1 answer
How to write big files with BinaryWriter
I have some program which write a large binary files. And I meet the problem: sometimes my programm crash on file writing without throwing any error (block catch don't execute. I write some test console application to find and fix this problem.…

Alexander Ochkanov
- 21
- 1
- 2
0
votes
3 answers
Decimal to ByteArray & write to offset
I want to know how I would convert from a decimal number located in a text box to hexadecimal and then to a byte array and write this array to the offset I want, using BinaryWriter.
My textBox11 decimal value is "101200001" and I need to write the…

Alan Alvarez
- 109
- 5
- 13
0
votes
2 answers
BinaryReader and BinaryWriter file handle in Delphi Prism
I want to be able to read and write into a file in the same instance or through same file handle. What I mean is this. Say you open a file as follows.
BinaryReader jfile := new BinaryReader(File.OpenRead('c:\jokes.dat'));
I want to be able to also…

ThN
- 3,235
- 3
- 57
- 115
-1
votes
1 answer
C# binary writer and reader
Problem that I am having is :
I am reading a array of bytes using binary reader to construct a windows gui for editing of a file, for instance I am reading the following byte array:
123cbb75
//read the first 4 bytes from 0x36A2
byte[] buffer =…

celtics33
- 15
- 6
-1
votes
1 answer
Create .wav from multiple sine waves and play all at once
I'm wondering if there is a way to adapt the code shown here so that I can basically make an array of beeps and play them all at once.
I tried making global MemoryStream and BinaryWriter to use, calculating everything ahead of time for the size but…

JDoe
- 19
- 4
-1
votes
1 answer
Best way to write byte[] into binary file
I have a 1GB in server A, I must use Read() method to get it to local. It is splitted into packages (16517 package). Each package is 65536 bytes include header.
Current, I use BinaryWriter to write each package into file directly. But it took me…

GSP
- 574
- 3
- 7
- 34
-1
votes
1 answer
Write binary/hexadecimal value into .bin file from list of string/int
I want to write a long list of binary number into a binary file from a list. The list are now all Hexadecimal number. My code below is not giving what i want like case 1, instead it output case 2. Please help.
Case 1: What i need is a binary file -…

LipFong
- 3
- 4
-1
votes
1 answer
How to to write binary data in specific format using C#?
I am writing C# classes to export Seg-Y files for educational purposes. Seg-Y files are basically files written in a predefined format to store big chunks of binary Seismic data. In these files we define the format of numeric data in the header (for…
-1
votes
2 answers
Binary Writer/Reader extra character
I am converting some legacy VB6 code to C# and this just has me a little baffled. The VB6 code wrote certain data sequentially to a file. This data is always 110 bytes. I can read this file just fine in the converted code, but I'm having trouble…

Calix
- 1
- 3
-1
votes
1 answer
BinaryWriter write bytes from TextBox
I have been trying to make a test program, that writes a byte from a textbox to an offset in another textbox.
I have been trying to do that:
using (BinaryWriter bw = new BinaryWriter(File.OpenWrite(ofd.FileName)))
{
…

Gal
- 1
- 1