/// <summary> /// Stream the field from a buffer /// </summary> /// <param name="input"></param> public override void Read(IO.EndianReader input) { Internal = input.ReadBytes(Value); #if DEBUG if (TracingEnabled && Value > 5) { byte[] data = input.ReadBytes(Value); for (int x = 0, y = 0, z = 0; x < data.Length; x++) { if (data[x] != 0) { if (y == 0 || x == 0) { y = x; } z++; } else if (x != 0 && data[x - 1] != 0) { trace.WriteLine("Found data at offset 0x{0:X} covering 0x{1:X} bytes, in a pad field with a count of {1}", y, z, Value); } } data = null; } #endif }
/// <summary> /// Stream the field from a buffer /// </summary> /// <param name="input"></param> public override void Read(IO.EndianReader input) { #if false//DEBUG if (Value < 5) { input.Seek(Value, System.IO.SeekOrigin.Current); } else { byte[] data = input.ReadBytes(Value); for (int x = 0, y = 0, z = 0; x < data.Length; x++) { if (data[x] != 0) { if (y == 0 || x == 0) { y = x; } z++; } else if (x != 0 && data[x - 1] != 0) { trace.WriteLine("Found data at offset 0x{0:X} covering 0x{1:X} bytes, in a pad field with a count of {1}", y, z, Value); } } data = null; } #else input.Seek(Value, System.IO.SeekOrigin.Current); #endif }