From 12e9ca6e275680b6e36f6b23570bb2a623c7ee24 Mon Sep 17 00:00:00 2001 From: lidgren Date: Sun, 12 Sep 2010 20:04:27 +0000 Subject: [PATCH] NetIncomingMessage.PositionInBytes added --- Lidgren.Network/NetIncomingMessage.Read.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Lidgren.Network/NetIncomingMessage.Read.cs b/Lidgren.Network/NetIncomingMessage.Read.cs index d652dd0..e16338f 100644 --- a/Lidgren.Network/NetIncomingMessage.Read.cs +++ b/Lidgren.Network/NetIncomingMessage.Read.cs @@ -41,6 +41,14 @@ namespace Lidgren.Network set { m_readPosition = (int)value; } } + /// + /// Gets the position in the buffer in bytes; note that the bits of the first returned byte may already have been read - check the Position property to make sure. + /// + public int PositionInBytes + { + get { return (int)(m_readPosition / 8); } + } + static NetIncomingMessage() { Type[] integralTypes = typeof(Byte).Assembly.GetTypes();