Esempio n. 1
0
 static void Main(string[] args)
 {
     var planner = new ConstructPlanner();
     var plan = planner.CreatePlan<ExtraLargeData>();
     using (var ms = new MemoryStream())
     {
         plan.WriteConstruct(new ExtraLargeData(), new ConstructWriterStream(ms));
         Console.WriteLine(ms.Length);
     }
 }
        public void CreatesCorrectStringFromBuffer()
        {
            var stream = new ConstructReaderStream(DataStream.Create("test", Encoding.UTF8));

            var planner = new ConstructPlanner();

            var plan = planner.CreatePlan<FixedLengthStringConstruct>();

            var result = plan.ReadConstruct(stream);

            Assert.AreEqual("test", result.FixedString);
        }