byte[] input = new byte[] {2, 4, 5, 2, 1};
ByteBuffer bytebuf = ByteBuffer.wrap(input);
ByteBuffer.wrap(byte[] array)
method makes buffer and array are inter-connected, modifications to the buffer will cause the array to be modified and vice versa.
The equivalent of ByteBuffer
in C# is memorystream. But I don't know how to connect memorystream with array likes ByteBuffer.wrap()
method did.
Can someone tell what is the equivalent of ByteBuffer.wrap()
in C#?
I have searched everywhere but could not find the answer at all.
Thanks in advance.