dnSpy.Contracts.Hex.HexBuffer.Replace C# (CSharp) Method

Replace() public method

Replaces the byte at position with value
public Replace ( HexPosition position, byte value ) : void
position HexPosition Position
value byte New value
return void
		public void Replace(HexPosition position, byte value) {
			using (var ed = CreateEdit()) {
				ed.Replace(position, value);
				ed.Apply();
			}
		}

Same methods

HexBuffer::Replace ( HexPosition position, byte data, long index, long length ) : void
HexBuffer::Replace ( HexPosition position, double value ) : void
HexBuffer::Replace ( HexPosition position, float value ) : void
HexBuffer::Replace ( HexPosition position, int value ) : void
HexBuffer::Replace ( HexPosition position, long value ) : void
HexBuffer::Replace ( HexPosition position, sbyte value ) : void
HexBuffer::Replace ( HexPosition position, short value ) : void
HexBuffer::Replace ( HexPosition position, uint value ) : void
HexBuffer::Replace ( HexPosition position, ulong value ) : void
HexBuffer::Replace ( HexPosition position, ushort value ) : void

Usage Example

		public static void Write(HexBuffer buffer, HexPosition position, byte[] data) {
			if (buffer == null)
				throw new ArgumentNullException(nameof(buffer));
			if (data == null || data.Length == 0)
				return;
			buffer.Replace(position, data);
		}