예제 #1
0
 public HexDocument(IHexStream stream, string name)
 {
     if (stream == null)
         throw new ArgumentNullException("stream");
     this.stream = stream;
     this.Name = name;
 }
예제 #2
0
파일: IHexStream.cs 프로젝트: xornand/dnSpy
        /// <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);
        }
예제 #3
0
 public HexDocument(IHexStream stream, string name)
 {
     if (stream == null)
     {
         throw new ArgumentNullException(nameof(stream));
     }
     this.stream = stream;
     this.Name   = name;
 }
예제 #4
0
파일: IHexStream.cs 프로젝트: xornand/dnSpy
 /// <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);
 }