NetworkCommsDotNet.Tools.PacketBuilder.NumUnusedBytesMostRecentPartialPacket C# (CSharp) Method

NumUnusedBytesMostRecentPartialPacket() public method

Returns the number of unused bytes in the most recently cached partial packet.
public NumUnusedBytesMostRecentPartialPacket ( ) : int
return int
        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.");
            }
        }