示例#1
0
            /// <summary>
            /// </summary>
            protected void ReadHeader()
            {
                _header = new DbaseFileHeader();
                // read the header
                _header.ReadHeader(_dbfStream,
                                   _parent._streamProvider is FileStreamProvider
                        ? ((FileStreamProvider)_parent._streamProvider).Path
                        : null);

                // how many records remain
                _readPosition = _header.HeaderLength;
            }
 /// <summary>
 /// Gets the header information for the dbase file.
 /// </summary>
 /// <returns>DbaseFileHeader contain header and field information.</returns>
 public DbaseFileHeader GetHeader()
 {
     if (_header == null)
     {
         using (var stream = _streamProvider.OpenRead())
             using (var dbfStream = new BinaryReader(stream))
             {
                 _header = new DbaseFileHeader();
                 // read the header
                 _header.ReadHeader(dbfStream, _streamProvider is FileStreamProvider ? ((FileStreamProvider)_streamProvider).Path : null);
             }
     }
     return(_header);
 }