public byte[] GetAllData()
{
lock (Locker)
{
byte[] returnArray = new byte[totalBytesCached];
int currentStart = 0;
for (int i = 0; i < packets.Count; i++)
{
Buffer.BlockCopy(packets[i], 0, returnArray, currentStart, packetActualBytes[i]);
currentStart += packetActualBytes[i];
}
return returnArray;
}
}