public LIDATARecord(RecordReader reader, RecordContext context) : base(reader, context) { this.SegmentIndex = reader.ReadIndex(); if (SegmentIndex == 0 || SegmentIndex > context.Segments.Count) { throw new InvalidDataException("SegmentIndex is out of range."); } this.DataOffset = reader.ReadUInt16Or32(); this.Data = reader.ReadToEnd(); // TODO: parse LIDATA (recursive; a bit messy) }
public LEDATARecord(RecordReader reader, RecordContext context) : base(reader, context) { UInt16 segmentIndex = reader.ReadIndex(); if (segmentIndex == 0 || segmentIndex > context.Segments.Count) { throw new InvalidDataException("SegmentIndex is out of range."); } this.Segment = context.Segments[segmentIndex - 1]; this.DataOffset = reader.ReadUInt16Or32(); this.Data = reader.ReadToEnd(); // TBD: this can be optimized to // reduce extra data copy // Fill the segment's data. if (Data.Length + DataOffset > Segment.Length) { throw new InvalidDataException("The LEDATA overflows the segment."); } Array.Copy(Data, 0, Segment.Data, DataOffset, Data.Length); }
internal UnknownComment(RecordReader reader, byte commentClass) { this.CommentClass = commentClass; this.Data = reader.ReadToEnd(); }
public LIDATARecord(RecordReader reader, RecordContext context) : base(reader, context) { this.SegmentIndex = reader.ReadIndex(); if (SegmentIndex == 0 || SegmentIndex > context.Segments.Count) throw new InvalidDataException("SegmentIndex is out of range."); this.DataOffset = reader.ReadUInt16Or32(); this.Data = reader.ReadToEnd(); // TODO: parse LIDATA (recursive; a bit messy) }
public LEDATARecord(RecordReader reader, RecordContext context) : base(reader, context) { UInt16 segmentIndex = reader.ReadIndex(); if (segmentIndex == 0 || segmentIndex > context.Segments.Count) { throw new InvalidDataException("SegmentIndex is out of range."); } this.Segment = context.Segments[segmentIndex - 1]; this.DataOffset = reader.ReadUInt16Or32(); this.Data = reader.ReadToEnd(); // TBD: this can be optimized to // reduce extra data copy // Fill the segment's data. if (Data.Length + DataOffset > Segment.Length) throw new InvalidDataException("The LEDATA overflows the segment."); Array.Copy(Data, 0, Segment.Data, DataOffset, Data.Length); }