// Copyright 2017-2018 Alexander Luzgarev using System.IO; namespace MatFileHandler.Tests { /// /// Factory providing the parsed contents of .mat files, /// which start at a non-8 byte-aligned offset in the stream. /// public class UnalignedMatTestDataFactory : MatTestDataFactory { /// /// Initializes a new instance of the class. /// /// Directory containing test files. public UnalignedMatTestDataFactory(string testDirectory) : base(testDirectory) { } /// protected override IMatFile ReadDataFromStream(Stream stream) { using (var ms = new MemoryStream()) { ms.Seek(3, SeekOrigin.Begin); stream.CopyTo(ms); ms.Seek(3, SeekOrigin.Begin); return base.ReadDataFromStream(ms); } } } }