示例#1
0
        public static void dbg_RWString()
        {
            System.IO.MemoryStream str = new System.IO.MemoryStream();
            StreamAccessor         ac  = new StreamAccessor(str);

            ac.Write("今日は", EncodingType.NoSpecified);
            ac.Stream.Position = 0;
            dumpMemoryStream(str);

            System.Console.WriteLine(ac.Read <string>(EncodingType.NoSpecified));
        }
示例#2
0
        public static void dbg_RWScheduledClass()
        {
            System.IO.MemoryStream str = new System.IO.MemoryStream();
            StreamAccessor         ac  = new StreamAccessor(str);

            TargetClass t1 = new TargetClass();

            t1.Init();
            t1.WriteToConsole();
            ac.Write(t1, EncodingType.NoSpecified);
            ac.Stream.Position = 0;

            dumpMemoryStream(str);

            TargetClass t2 = ac.Read <TargetClass>();

            t2.WriteToConsole();
        }