当前位置: 首页>>代码示例>>C#>>正文


C# BinaryReader.ReadDouble方法代码示例

本文整理汇总了C#中System.IO.BinaryReader.ReadDouble方法的典型用法代码示例。如果您正苦于以下问题:C# BinaryReader.ReadDouble方法的具体用法?C# BinaryReader.ReadDouble怎么用?C# BinaryReader.ReadDouble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.BinaryReader的用法示例。


在下文中一共展示了BinaryReader.ReadDouble方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeserializeBody

 public override void DeserializeBody(BinaryReader br)
 {
     n = br.ReadInt32();
     x = br.ReadDouble();
     y = br.ReadDouble();
     zoom = br.ReadDouble();
 }
开发者ID:sochix,项目名称:TLSharp,代码行数:7,代码来源:TLMaskCoords.cs

示例2: StatisticRead

        public void StatisticRead(string FileName)
        {
            // Read the file.
            FileStream fs;
            // Create the reader for data.
            fs = new FileStream(FileName, FileMode.Open, FileAccess.Read);
            BinaryReader r = new BinaryReader(fs);
            // Read data from Test.data.
            double[] ar = new double [FileLenght];

            string str = "";
            //		StatisticalData [] stat = new StatisticalData[FileLenght];
            for (int i = 0; i < FileLenght; i++)
            {
            //		ar[i] = r.ReadDouble();
                stat[i].mean = r.ReadByte();
                stat[i].sigma = r.ReadByte();
                stat[i].K = r.ReadDouble();
                stat[i].P = r.ReadDouble();
                stat[i].Z = r.ReadDouble();
                //		str = str + ";" + ar[i].ToString();
                //	Console.WriteLine(r.ReadInt32());
            }

            //	MessageBox.Show("Loaded data is: " + str);
            str.Remove(0,str.Length);
            r.Close();
            fs.Close();
        }
开发者ID:harshanad112,项目名称:KmeansDemo,代码行数:29,代码来源:StatisticStream.cs

示例3: Read

		public override object Read(BinaryReader reader)
		{
			reader.ReadByte();
			int id = reader.ReadInt32();
			InstrumentType type = (InstrumentType)reader.ReadByte();
			string symbol = reader.ReadString();
			string description = reader.ReadString();
			byte currencyId = reader.ReadByte();
			string exchange = reader.ReadString();
			Instrument instrument = new Instrument(id, type, symbol, description, currencyId, exchange);
			instrument.tickSize = reader.ReadDouble();
			instrument.maturity = new DateTime(reader.ReadInt64());
			instrument.factor = reader.ReadDouble();
			instrument.strike = reader.ReadDouble();
			instrument.putcall = (PutCall)reader.ReadByte();
			instrument.margin = reader.ReadDouble();
			int num = reader.ReadInt32();
			for (int i = 0; i < num; i++)
			{
				AltId altId = new AltId();
				altId.providerId = reader.ReadByte();
				altId.symbol = reader.ReadString();
				altId.exchange = reader.ReadString();
				instrument.altId.Add(altId);
			}
			return instrument;
		}
开发者ID:ForTrade,项目名称:CSharp,代码行数:27,代码来源:InstrumentStreamer.cs

示例4: ParseStations

        public static IList<Station> ParseStations(Stream stream)
        {
            using (var reader = new BinaryReader (stream, System.Text.Encoding.UTF8, true)) {
                var count = reader.ReadInt32 ();
                var stations = new Station[count];
                for (int i = 0; i < count; i++) {
                    stations [i] = new Station {
                        Id = reader.ReadInt32 (),
                        Street = reader.ReadString (),
                        Name = reader.ReadString(),
                        StationType = reader.ReadInt32(),
                        b = reader.ReadBoolean(),
                        su = reader.ReadBoolean(),
                        t = reader.ReadBoolean(),
                        bk = reader.ReadBoolean(),
                        bl = reader.ReadBoolean(),
                        Latitude = reader.ReadDouble(),
                        Longitude = reader.ReadDouble(),
                        EmptySlotCount = reader.ReadInt32(),
                        dx = reader.ReadInt32(),
                        BikeCount = reader.ReadInt32(),
                        bx = reader.ReadInt32()
                    };
                }

                return stations;
            }
        }
开发者ID:SpiderMaster,项目名称:BikeNow,代码行数:28,代码来源:StationUtils.cs

示例5: Load

        public static Room Load(string filename)
        {
            Room newRoom;
            if (!File.Exists(filename)) return null;
            using (var stream = File.Open(filename, FileMode.Open))
            using (var reader = new BinaryReader(stream, Encoding.UTF8))
            {

                var hd = Encoding.UTF8.GetBytes(Header);
                var buffer = new byte[hd.Length];
                reader.Read(buffer, 0, buffer.Length);
                var readHeader = Encoding.UTF8.GetString(buffer);
                if (readHeader != Header) return null;

                //writer.Write(hd, 0, hd.Length);
                var posX = reader.ReadDouble();
                //writer.Write(room.Position.X);
                var posY = reader.ReadDouble();
                // writer.Write(room.Position.Y);
                var tilesLength = reader.ReadInt32();
                //writer.Write(room.Tiles.Length);
                newRoom = new Room(new Point(posX, posY))
                {
                    Tiles = new Tile[tilesLength]
                };

                for (var i = 0; i < tilesLength; i++)
                {
                    var tt = (TileTypes)reader.ReadInt32();
                    newRoom.Tiles[i] = new Tile() { TileType = tt };
                }
            }
            return newRoom;

        }
开发者ID:xeonixen,项目名称:DungeonEditor,代码行数:35,代码来源:FileHandler.cs

示例6: ReadFromRecorder

 public override void ReadFromRecorder(BinaryReader reader)
 {
     PredictedLeftLegAngle = reader.ReadDouble();
     PredictedRightLegAngle = reader.ReadDouble();
     PredictedPersonHeading = reader.ReadDouble();
     IsLearned = reader.ReadDouble() == 1d;
 }
开发者ID:philipdaubmeier,项目名称:BodyOrientation,代码行数:7,代码来源:LearnerPredictedFeatureSet.cs

示例7: Load

        /// <summary>
        /// Loads a room data and image file
        /// </summary>
        /// <param name="dataFile">Room data file</param>
        /// <param name="imageFile">Room image file</param>
        /// <returns></returns>
        public static Room Load(string dataFile,string imageFile)
        {
            var dataFileWithPath = Directory.GetParent(Directory.GetCurrentDirectory())[email protected]"\Images\"+dataFile;
            Room newRoom;
            if (!File.Exists(dataFileWithPath)) return null;
            using (var stream = File.Open(dataFileWithPath, FileMode.Open))
            using (var reader = new BinaryReader(stream, Encoding.UTF8))
            {

                var hd = Encoding.UTF8.GetBytes(Header);
                var buffer = new byte[hd.Length];
                reader.Read(buffer, 0, buffer.Length);
                var readHeader = Encoding.UTF8.GetString(buffer);
                if (readHeader != Header) return null;

                var posX = reader.ReadDouble();
                var posY = reader.ReadDouble();
                var tilesLength = reader.ReadInt32();
                newRoom = new Room(new Vector2((float)posX,(float)posY),imageFile)
                {
                    Tiles = new Tile[tilesLength]
                };

                for (var i = 0; i < tilesLength; i++)
                {
                    var tt = (TileTypes)reader.ReadInt32();
                    newRoom.Tiles[i] = new Tile() { TileType = tt };
                }
            }
            return newRoom;

        }
开发者ID:Kursledare,项目名称:Mookieraw,代码行数:38,代码来源:FileHandler.cs

示例8: Initialize

		public override void Initialize(DrawArgs drawArgs)
		{
			FileInfo boundaryFileInfo = new FileInfo(this._boundaryFilePath);
			if(!boundaryFileInfo.Exists)
			{
				this.isInitialized = true;
				return;
			}

			using( FileStream boundaryFileStream = boundaryFileInfo.OpenRead() )
			using( BinaryReader boundaryFileReader = new BinaryReader(boundaryFileStream, System.Text.Encoding.ASCII) ) {
				int numBoundaries = boundaryFileReader.ReadInt32();
				int count = boundaryFileReader.ReadInt32();
				this.vertices = new CustomVertex.PositionColored[count];

				for(int i = 0; i < count; i++) {
					double lat = boundaryFileReader.ReadDouble();
					double lon = boundaryFileReader.ReadDouble();
					Vector3 v = MathEngine.SphericalToCartesian((float)lat, (float)lon, (float)(this._parentWorld.EquatorialRadius + this._distanceAboveSurface));
					this.vertices[i].X = v.X;
					this.vertices[i].Y = v.Y;
					this.vertices[i].Z = v.Z;
					this.vertices[i].Color = this._color;
				}

			}
			this.isInitialized = true;
		}
开发者ID:jpespartero,项目名称:WorldWind,代码行数:28,代码来源:BoundaryLayer.cs

示例9: Poly

        public Poly(BinaryReader file, int shapeType, string entryType, int misc, string country)
        {
            ShapeType = shapeType;
            EntryType = entryType;
            Misc = misc;
            Country = country;

            //read Poly from Shapefile
            float minX = (float)file.ReadDouble();
            float minY = (float)file.ReadDouble();
            float maxX = (float)file.ReadDouble();
            float maxY = (float)file.ReadDouble();
            box = new RectangleF(minX, minY, maxX - minX, maxY - minY);

            int numParts = file.ReadInt32();
            parts = new PointF[numParts][];

            int numPoints = file.ReadInt32(); //total number of points
            file.ReadInt32(); //skip first part index (which should always be 0)
            int prevPartIndex = 0;

            for (int i = 0; i < numParts - 1; i++)
            {
                int partIndex = file.ReadInt32(); //index to first point in (next) part
                parts[i] = new PointF[partIndex - prevPartIndex];
                prevPartIndex = partIndex;
            }
            parts[parts.Length - 1] = new PointF[numPoints - prevPartIndex]; //final part

            for (int i = 0; i < numParts; i++)
                for (int j = 0; j < parts[i].Length; j++)
                    parts[i][j] = new PointF((float)file.ReadDouble(), (float)file.ReadDouble());
        }
开发者ID:Winterstark,项目名称:Alot-of-Knowledge,代码行数:33,代码来源:GeoData.cs

示例10: Read

 public override object Read(BinaryReader reader, byte version)
 {
     if (version == 0)
         return new Bid(new DateTime(reader.ReadInt64()), reader.ReadByte(), reader.ReadInt32(), reader.ReadDouble(), reader.ReadInt32());
     else
         return new Bid(new DateTime(reader.ReadInt64()), new DateTime(reader.ReadInt64()), reader.ReadByte(), reader.ReadInt32(), reader.ReadDouble(), reader.ReadInt32());
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:7,代码来源:TickStreamers.cs

示例11: Read

        /// <summary>
        /// データ 読み込み
        /// </summary>
        /// <param name="strm"></param>
        public void Read(BinaryReader strm)
        {
            strm.ReadInt32(); // 要素数

            wdPosX = strm.ReadDouble();
            wdPosY = strm.ReadDouble();
        }
开发者ID:terakenxx,项目名称:TukubaChallenge,代码行数:11,代码来源:CheckPointData.cs

示例12: Node

        public Node(System.IO.Stream stream)
        {
            int id;
            double lat,lon;

            try{
                byte[] array = new byte[sizeof(int) + sizeof(double) * 2];
                stream.Read(array, 0, array.Length);
            //                ByteBuffer buffer = new ByteBuffer(array);
                MemoryStream ms = new MemoryStream(array);
                BinaryReader buffer = new BinaryReader(ms);

                id = buffer.ReadInt32();
                lat = buffer.ReadDouble();
                lon = buffer.ReadDouble();
            //                BinaryReader by = new BinaryReader(stream);
                //id = by.ReadInt32();
                //lat = by.ReadDouble();
                //lon = by.ReadDouble();
            }
            catch(Exception e)
            {
                id = 0;
                lat = 0.0;
                lon = 0.0;
            }

            this.id = id;
            this.lat = lat;
            this.lon = lon;
        }
开发者ID:ackratos,项目名称:USTCMap,代码行数:31,代码来源:Node.cs

示例13: Read

            public void Read(BinaryReader reader, UInt16 version)
            {
                float x, y;
                x = (float)reader.ReadDouble();
                y = (float)reader.ReadDouble();

                Location = new PointF(x, y);
            }
开发者ID:noshbar,项目名称:TISFAT-Zero,代码行数:8,代码来源:PolyObject.Joint.cs

示例14: Read

		public override object Read(BinaryReader reader)
		{
			if (reader.ReadByte() == 0)
			{
				return new Ask(new DateTime(reader.ReadInt64()), reader.ReadByte(), reader.ReadInt32(), reader.ReadDouble(), reader.ReadInt32());
			}
			return new Ask(new DateTime(reader.ReadInt64()), new DateTime(reader.ReadInt64()), reader.ReadByte(), reader.ReadInt32(), reader.ReadDouble(), reader.ReadInt32());
		}
开发者ID:ForTrade,项目名称:CSharp,代码行数:8,代码来源:AskStreamer.cs

示例15: Molecule

 public Molecule(BinaryReader reader)
 {
     AtomCount = FileUtils.ReadInt32Array(reader);
     AtomType = FileUtils.ReadInt32Array(reader);
     MolecularWeight = reader.ReadDouble();
     MonoIsotopicMass = reader.ReadDouble();
     mostLikelyMass = reader.ReadDouble();
 }
开发者ID:neuhauser,项目名称:compbio-base,代码行数:8,代码来源:Molecule.cs


注:本文中的System.IO.BinaryReader.ReadDouble方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。