In C# 2.0, I am processing data from a socket. There are cases, where
I pull 12 bytes from the socket and determine that the next X bytes
should be ignored, where X is determined by observing each 12 bytes of
data.
Currently, I am allocating a byte array of X bytes and using
Socket.Receive(...) to pull the remaining X bytes off the socket and
discarding them:
byte[] discardData = new byte[numBytesToDiscard];
socket.Receive(discardData, 0, numBytesToDiscard, SocketFlags.None);
Is there a way in C# to just push the socket pointer up by X bytes
without having to copy the bytes into an array?