Reputation: 17
I have a couple questions about byte arrays
My first question this is a byte array correct?
byte[] array = {0x90, 0x38, 0x83, 0x49}
question 2 is would memorystream.ToArray();
produce the same as question 1 or am I wrong.
If i am wrong how can i produce question 1 with question 2 or is it not possible?
Thank you
Upvotes: 0
Views: 53
Reputation: 16104
Q1: byte[] array
is an array of type "byte" which is commonly referred to as "byte array".
Mind that byte
is an alias for System.Byte
. So you could come across Byte[]
, which will also be referred to as "byte array". ( Also mind, that this can be quite different in other languages like Java! )
Q2: MSDN says:
Writes the stream contents to a byte array, regardless of the Position property.
So given the MemoryStream's contents are the bytes mentioned, then yes, you would get a byte array with the bytes of q1.
Upvotes: 2