public HexDocument(IHexStream stream, string name) { if (stream == null) throw new ArgumentNullException("stream"); this.stream = stream; this.Name = name; }
/// <summary> /// Reads bytes /// </summary> /// <param name="self">Stream</param> /// <param name="offset">Offset</param> /// <param name="size">Size of data to read</param> /// <returns></returns> public static byte[] ReadBytes(this IHexStream self, ulong offset, int size) { var data = new byte[size]; self.Read(offset, data, 0, data.Length); return(data); }
public HexDocument(IHexStream stream, string name) { if (stream == null) { throw new ArgumentNullException(nameof(stream)); } this.stream = stream; this.Name = name; }
/// <summary> /// Writes bytes /// </summary> /// <param name="self">Stream</param> /// <param name="offset">Offset</param> /// <param name="data">Data</param> public static void Write(this IHexStream self, ulong offset, byte[] data) { Debug.Assert(data.LongLength <= int.MaxValue); self.Write(offset, data, 0, data.Length); }