public void Put(ushort value) { if (_autoResize) { ResizeIfNeed(_position + 2); } FastBitConverter.GetBytes(_data, _position, value); _position += 2; }
public void Put(ulong value) { if (_autoResize) { ResizeIfNeed(_position + 8); } FastBitConverter.GetBytes(_data, _position, value); _position += 8; }
public void Put(float value) { if (_autoResize) { ResizeIfNeed(_position + 4); } FastBitConverter.GetBytes(_data, _position, value); _position += 4; }
public void PutBytesWithLength(byte[] data) { if (_autoResize) { ResizeIfNeed(_position + data.Length + 4); } FastBitConverter.GetBytes(_data, _position, data.Length); Buffer.BlockCopy(data, 0, _data, _position + 4, data.Length); _position += data.Length + 4; }
public void PutBytesWithLength(byte[] data, int offset, int length) { if (_autoResize) { ResizeIfNeed(_position + length + 4); } FastBitConverter.GetBytes(_data, _position, length); Buffer.BlockCopy(data, offset, _data, _position + 4, length); _position += length + 4; }
private void PutArray(Array arr, int sz) { ushort length = arr == null ? (ushort)0 : (ushort)arr.Length; sz *= length; if (_autoResize) { ResizeIfNeed(_position + sz + 2); } FastBitConverter.GetBytes(_data, _position, length); if (arr != null) { Buffer.BlockCopy(arr, 0, _data, _position + 2, sz); } _position += sz + 2; }
private void SetUInt64BE(int offset, ulong value) { FastBitConverter.GetBytes(Bytes, offset, SwapEndianness(value)); }