/// <summary>
        /// Reads and validates the header block from the map file.
        /// </summary>
        /// <param name="readBuffer">
        ///            the ReadBuffer for the file data. </param>
        /// <param name="fileSize">
        ///            the size of the map file in bytes. </param>
        /// <exception cref="IOException">
        ///             if an error occurs while reading the file. </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void readHeader(MapsforgeSharp.Reader.ReadBuffer readBuffer, long fileSize) throws java.io.IOException
        public virtual void ReadHeader(ReadBuffer readBuffer, long fileSize)
        {
            RequiredFields.ReadMagicByte(readBuffer);
            RequiredFields.ReadRemainingHeader(readBuffer);

            MapFileInfoBuilder mapFileInfoBuilder = new MapFileInfoBuilder();

            RequiredFields.readFileVersion(readBuffer, mapFileInfoBuilder);

            RequiredFields.ReadFileSize(readBuffer, fileSize, mapFileInfoBuilder);

            RequiredFields.ReadMapDate(readBuffer, mapFileInfoBuilder);

            RequiredFields.ReadBoundingBox(readBuffer, mapFileInfoBuilder);

            RequiredFields.ReadTilePixelSize(readBuffer, mapFileInfoBuilder);

            RequiredFields.ReadProjectionName(readBuffer, mapFileInfoBuilder);

            OptionalFields.ReadOptionalFields(readBuffer, mapFileInfoBuilder);

            RequiredFields.ReadPoiTags(readBuffer, mapFileInfoBuilder);

            RequiredFields.ReadWayTags(readBuffer, mapFileInfoBuilder);

            ReadSubFileParameters(readBuffer, fileSize, mapFileInfoBuilder);

            this.mapFileInfo = mapFileInfoBuilder.Build();
        }