1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-15 22:56:30 +09:00

Added byte to WriteAt

This commit is contained in:
Andrés Leone
2015-12-13 03:10:25 +01:00
parent 364f9bd4cb
commit 6dac4d7457

View File

@@ -101,6 +101,16 @@ namespace Lidgren.Network
m_bitLength += 8;
}
/// <summary>
/// Writes a byte at a given offset in the buffer
/// </summary>
public void WriteAt(Int32 offset, byte source) {
int newBitLength = Math.Max(m_bitLength, offset + 8);
EnsureBufferSize(newBitLength);
NetBitWriter.WriteByte((byte) source, 8, m_data, offset);
m_bitLength = newBitLength;
}
/// <summary>
/// Writes a signed byte
/// </summary>