/// <summary> /// Gets or sets a value in memory at a particular byte offset. /// </summary> /// <value>A value in memory.</value> public long this[uint offset] { get { LinearMemory.CheckBounds(mem, offset, 8); return((long)mem[(int)offset + 7] << 56 | (long)mem[(int)offset + 6] << 48 | (long)mem[(int)offset + 5] << 40 | (long)mem[(int)offset + 4] << 32 | (long)mem[(int)offset + 3] << 24 | (long)mem[(int)offset + 2] << 16 | (long)mem[(int)offset + 1] << 8 | (long)mem[(int)offset]); } set { LinearMemory.CheckBounds(mem, offset, 8); mem[(int)offset + 7] = (byte)(value >> 56); mem[(int)offset + 6] = (byte)(value >> 48); mem[(int)offset + 5] = (byte)(value >> 40); mem[(int)offset + 4] = (byte)(value >> 32); mem[(int)offset + 3] = (byte)(value >> 24); mem[(int)offset + 2] = (byte)(value >> 16); mem[(int)offset + 1] = (byte)(value >> 8); mem[(int)offset] = (byte)value; } }
/// <summary> /// Gets or sets a value in memory at a particular byte offset. /// </summary> /// <value>A value in memory.</value> public sbyte this[uint offset] { get { LinearMemory.CheckBounds(mem, offset, 1); return((sbyte)mem[(int)offset]); } set { LinearMemory.CheckBounds(mem, offset, 1); mem[(int)offset] = (byte)value; } }
/// <summary> /// Gets or sets a value in memory at a particular byte offset. /// </summary> /// <value>A value in memory.</value> public short this[uint offset] { get { LinearMemory.CheckBounds(mem, offset, 2); return((short)( (uint)mem[(int)offset + 1] << 8 | (uint)mem[(int)offset])); } set { LinearMemory.CheckBounds(mem, offset, 2); mem[(int)offset + 1] = (byte)(value >> 8); mem[(int)offset] = (byte)value; } }
/// <summary> /// Gets or sets a value in memory at a particular byte offset. /// </summary> /// <value>A value in memory.</value> public int this[uint offset] { get { LinearMemory.CheckBounds(mem, offset, 4); return((int)mem[(int)offset + 3] << 24 | (int)mem[(int)offset + 2] << 16 | (int)mem[(int)offset + 1] << 8 | (int)mem[(int)offset]); } set { LinearMemory.CheckBounds(mem, offset, 4); mem[(int)offset + 3] = (byte)(value >> 24); mem[(int)offset + 2] = (byte)(value >> 16); mem[(int)offset + 1] = (byte)(value >> 8); mem[(int)offset] = (byte)value; } }