public int NumUnusedBytesMostRecentPartialPacket()
{
lock (Locker)
{
if (packets.Count > 0)
{
int lastPacketIndex = packets.Count - 1;
return packets[lastPacketIndex].Length - packetActualBytes[lastPacketIndex];
}
else
throw new Exception("Unable to return requested size as packet list is empty.");
}
}