c# - BinaryWriter problem - "code adds some byte between Write() method" -
I'm trying to use some code BinaryWriter and then BinaryReader. When I want to write I use method () but the problem is that there is a new byte between the two types of writing method which is in the ASCII table in decimal 31 (some 24). You can see it on this image:
You can see that the byte ASCII decimal value is 31 by index 4 (5th byte). I did not include him there . As you can see that 1 4 bytes are reserved for a number (int 32), the next is the other data (mostly some text - it is no longer important). As you can see from the code I type: 1 in the row - 10 in the line text "This is some text ..." How come Is that between 5th byte (31st December) ?? And this is the code I got: If you look at, you will see that If you type a length-prefixed string 31 then your string has the number of characters - absolutely normal.
Fixed zero main (string [] args) Send {// ///// - Receive: // sending data (); Console.ReadLine (); } Private Static void SendingData () {int [] commandNumbers = {1, 5, 10}; // is for 10 users (when they send some text)! For (int i = 0; i
Comments
Post a Comment