Home > Net >  How do I will file into a byte [] array
How do I will file into a byte [] array

Time:12-05


Excuse me, great god, how to transform Zip file for the above format array

CodePudding user response:

Read into stream file format

CodePudding user response:

Do you have no example sends a

CodePudding user response:

It seems sbyte

CodePudding user response:

The File File=new File (" a.t xt ");
Byte [] bytesArray=new byte [(int) file. The length ()];
FileInputStream fs=new FileInputStream (file);
Fs. Read (bytesArray);

CodePudding user response:

Just write about
Also don't have to pay attention to look not good-looking, not performance, said only roughly, there should be a sbyte


 byte [] bb=new byte [] {0 x01, 0 XFF}; 

Var b=bb. Select (p=& gt; (sbyte) p);

Var BBB=new {inf=b};
Var test=System. Text. Json. JsonSerializer. Serialize (BBB);


The results

{" inf ": [1, 1]}
  •  Tags:  
  • C#
  • Related