public DataStreamRecord(int interval, DataStreamRecordType type, byte[] data) { Interval = interval; RecordType = type; Length = data.Length; Data = data; }
protected string ReadString(DataStreamRecordType type) { var data = ReadRecord(); Debug.Assert(data.RecordType == type); return(UTF8.GetString(data.Data)); }
public void Write(DataStreamRecordType type, int offset, byte[] source) { int count = source.Length - offset; byte[] data = new byte[count]; Array.Copy(source, offset, data, 0, count); Write(type, data); }
public void Write(DataStreamRecordType type, byte[] data) { Write((int)Stopwatch.ElapsedMilliseconds, type, data); }
public void Write(int interval, DataStreamRecordType type, byte[] data) { var record = new DataStreamRecord(interval, type, data); Write(record); }