What is a byte[] array?

前端 未结 6 1723
盖世英雄少女心
盖世英雄少女心 2021-02-13 11:49

What is a byte array is in the context of .NET framework?

I am familiar with standard definitions like array and byte and very fam

6条回答
  •  Happy的楠姐
    2021-02-13 12:33

    A byte is 8 bits, and an array of byte, is an array of bytes... It really is that simple.

    The thing to keep in mind is that char and byte are different. In old C style, a char and byte were basically the same thing. In .NET, characters are Unicode and can be anywhere from 8-32 bits per character. This is where encoding comes into play. You can convert a string to a byte array, and you can convert a byte array into a string by using the Encoding class.

提交回复
热议问题