UnityEngine.Networking.NetBuffer.WriteBytesAtOffset C# (CSharp) Method

WriteBytesAtOffset() public method

public WriteBytesAtOffset ( byte buffer, ushort targetOffset, ushort count ) : void
buffer byte
targetOffset ushort
count ushort
return void
        public void WriteBytesAtOffset(byte[] buffer, ushort targetOffset, ushort count)
        {
            uint num = (uint) (count + targetOffset);
            this.WriteCheckForSpace((ushort) num);
            if ((targetOffset == 0) && (count == buffer.Length))
            {
                buffer.CopyTo(this.m_Buffer, (int) this.m_Pos);
            }
            else
            {
                for (int i = 0; i < count; i++)
                {
                    this.m_Buffer[targetOffset + i] = buffer[i];
                }
            }
            if (num > this.m_Pos)
            {
                this.m_Pos = num;
            }
        }

Usage Example

コード例 #1
0
 public void Write(byte[] buffer, int offset, int count)
 {
     if (count > UInt16.MaxValue)
     {
         if (LogFilter.logError)
         {
             Debug.LogError("NetworkWriter Write: buffer is too large (" + count + ") bytes. The maximum buffer size is 64K bytes.");
         }
         return;
     }
     m_Buffer.WriteBytesAtOffset(buffer, (ushort)offset, (ushort)count);
 }
All Usage Examples Of UnityEngine.Networking.NetBuffer::WriteBytesAtOffset