Home > Net >  FlatBuffers deserialization problem, everyone who come in to give directions
FlatBuffers deserialization problem, everyone who come in to give directions

Time:09-17

Flat Buffers, written in the form of Byte [] array in written text, write the code below is
In here to see the number is normal, there are written by 10 times, from 401 to 410, written to a file,

When reading data, read the problem, under the code read

In the File. ReadAllBytes () reads all Byte, only type 401.
By line read word is a 319 and 10, 100. I don't know the problem there, bothers me for a week,, every brother please give directions

CodePudding user response:

Can't find, repeatedly written to the file example, baidu is a write

CodePudding user response:

I'm dying to know what you find the code is covered or additional

According to your description as cover

CodePudding user response:

Read your code, the problem on the save you

The code didn't see the save method
But I can probably guess what is the row

Please baidu 'c # additional written'

CodePudding user response:

The Save is additional

CodePudding user response:

Void the Save (string path, byte [] by)
{
if (! File. The Exists (path))
{
The Debug Log (" create ");
File. The Create (path). The Close ();
}
FileStream FileStream=new FileStream (path, FileMode. Append, FileAccess. Write);
FileStream. Write (by 0, by Length);
FileStream. The Dispose ();
FileStream. Close ();
}
Can't map,

CodePudding user response:

refer to the second floor wanghui0380 response:
I would like to know are you find the code coverage or additional

According to your description like cover

CodePudding user response:

Public static void (aa)
{
String path=@ "new text document. TXT";
if (! File. The Exists (path))
{
File. The Create (path). The Close ();
}
for (int i=0; I & lt; 10; I++)
{
Byte [] ss=Encoding. The Default. GetBytes (i.T oString ());

FileStream fs=new FileStream (path, FileMode. Append, FileAccess. Write);
Fs. Write (ss, 0, ss. Length);
Fs. The Dispose ();
Fs. The Close ();
}
}


It's no problem

CodePudding user response:

This is the same as mine

CodePudding user response:

Top, help, have a look
  •  Tags:  
  • C #
  • Related