System.IO.BinaryReader.ReadBoolean C# (CSharp) Method

ReadBoolean() public method

public ReadBoolean ( ) : bool
return bool
        public virtual bool ReadBoolean()
        {
            FillBuffer(1);
            return (_buffer[0] != 0);
        }

Usage Example

Example #1
1
        public Boolean fromFile(String path)
        {
            FileStream fs = new FileStream(path, FileMode.Open);
            BinaryReader reader = new BinaryReader(fs);
            try
            {
                String h = reader.ReadString();
                float v = BitConverter.ToSingle(reader.ReadBytes(sizeof(float)), 0);
                drawFloorModel = reader.ReadBoolean();
                showAlwaysFloorMap = reader.ReadBoolean();
                lockMapSize = reader.ReadBoolean();
                mapXsize = reader.ReadInt32();
                mapYsize = reader.ReadInt32();

                //edgeXのxはmapX-1
                //yはmapYsize

                return true;

            }
            catch (EndOfStreamException eex)
            {
                //握りつぶす
                return false;
            }
            finally
            {
                reader.Close();
            }
        }
All Usage Examples Of System.IO.BinaryReader::ReadBoolean