I have a function that takes an array as a parameter. The function then fills the array up with information of unknown length. So how would I create an array to store a message of unknown length? Because I can't specify the size of the array since I don't know the size of the message it is going to store.
Would this be valid?
byte [] array;
function (array);
And then the size of the array will be determined by the size of the message it is filled in? If this isn't possible how would I do this?
I need the array to be the exact size of the message it is filled up with, so I can't just specify the array to be some random size big enough to fit the message.
Additional, from a comment:
public int ReceiveFrom( byte[] buffer, int offset, int size,
SocketFlags socketFlags, ref EndPoint remoteEP )