Esempio n. 1
0
        internal BinaryReaderX CreateReader(Stream stream)
        {
            var reader = new BinaryReaderX()
            {
                Stream = stream
            };

            reader.Settings.EncodeInt  = false;
            reader.Settings.UseObjRef  = false;
            reader.Settings.SizeFormat = TypeCode.Int16;
            reader.Settings.Encoding   = Encoding;
//#if DEBUG
//            reader.Debug = true;
//            reader.EnableTraceStream();
//#endif
            return(reader);
        }
Esempio n. 2
0
 //读取方案数据
 public static LotTickData[] ReadData(string fileName)
 {
     NewLife.Serialization.BinaryReaderX reader = new NewLife.Serialization.BinaryReaderX();
     FileStream fs = new FileStream(fileName, FileMode.Open );
     reader.Reader = new BinaryReader(fs);
     return (LotTickData[])reader.ReadObject(typeof(LotTickData[]));
 }