/// <summary>Gets the value at the given index.</summary> protected override object Get(int index) { if (rawBuffer == null) { // Use the _Buffer instead: return(LittleConverter.ToUInt16(_Buffer.buffer, (index * 2) + ByteOffset)); } return(rawBuffer[index]); }
/// <summary> /// Gets or sets the given entry in the array. /// </summary> public ushort this[int index] { get{ if (rawBuffer == null) { // Use the _Buffer instead: return(LittleConverter.ToUInt16(_Buffer.buffer, (index * 2) + ByteOffset)); } return(rawBuffer[index]); } set{ if (rawBuffer == null) { // Use the _Buffer instead: LittleConverter.GetBytes(value, _Buffer.buffer, (index * 2) + ByteOffset); return; } rawBuffer[index] = value; } }