MemoryStream: why convert to byte after readByte

前端 未结 3 717
眼角桃花
眼角桃花 2021-01-17 11:46

In this example from MS, you\'ll notice that after we read a byte from memory stream, it goes into an int which must then be converted to byte. It stikes me as strange that

3条回答
  •  萌比男神i
    2021-01-17 12:10

    I do believe they are converting with that from int to byte in a reallllllly nice way, since ReadByte() returns an int and their byteArray is of type int[].

提交回复
热议问题