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