By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,515 Members | 1,042 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,515 IT Pros & Developers. It's quick & easy.

BinaryReader C# Problem

P: n/a
I'm reading in a text file 602 bytes at a time, using the code below.
One of the lines has text that looks like this: "Cell#+9 and
more text here going to 602 characters for each line."

For some reason when this line is encoded the +9 is gone and
everything is moved to the left 2 bytes.

How can I get around this.

byte[] buff = new byte[602];

// Create the reader for data.
FileStream fs = new FileStream(filename, FileMode.Open,
BinaryReader r = new BinaryReader(fs);
line = System.Text.Encoding.ASCII.GetString(buff as

I have also tried
System.Text.Encoding.UTF7.GetString(buff as System.Byte[]); with the
same result
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
* my********* (mike) scripsit:

Why do you post a C# question to /this/ group?!

Herfried K. Wagner [MVP]
Nov 20 '05 #2

P: n/a
Hi Mike,

The Csharp newsgroup is two flours higher just above the Jscript newsgroup

I hope this helps

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.