W
Will
I have a byte array buffer that is of a static size.
byte[] buffer = new byte[512];
Data is being read into it using NetworkStream.Read
int countBytes = netStream.Read(buffer, 0, buffer.Length);
For my applicaion, I need to output exactly the number of bytes that were
read in, not the entire buffer. Basically, I need to know how to do
something like this (I know this won't work).
byte[] output = buffer.subString(0, countBytes);
How do I create a new byte array of the correct length?
Thanks in advance,
Will.
byte[] buffer = new byte[512];
Data is being read into it using NetworkStream.Read
int countBytes = netStream.Read(buffer, 0, buffer.Length);
For my applicaion, I need to output exactly the number of bytes that were
read in, not the entire buffer. Basically, I need to know how to do
something like this (I know this won't work).
byte[] output = buffer.subString(0, countBytes);
How do I create a new byte array of the correct length?
Thanks in advance,
Will.