SkipPadBits() public method

Pads data with enough bits to reach a full byte. Decreases cpu usage for subsequent byte writes.
public SkipPadBits ( ) : void
return void
Ejemplo n.º 1
0
            /// <summary>
            /// Extracts the data from a message
            /// </summary>
            /// <param name="message">message packed with data</param>
            public void ExtractPacketData(NetIncomingMessage message)
            {
                try
                {
                    message.SkipPadBits();
                    Gets(message);
                    message.SkipPadBits();
                }
                catch (NetException)
                {
                    CorruptPackage();
                }
                catch (ArgumentOutOfRangeException)
                {
                    CorruptPackage();
                }
                catch (IndexOutOfRangeException)
                {
                    CorruptPackage();
                }

                _readOnly = true;
            }