public DbaseWriter(string filename) { _dbaseFileStream = File.Open(filename, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read); _dbaseWriter = new BinaryWriter(_dbaseFileStream, Encoding.ASCII); _dbaseReader = new BinaryReader(_dbaseFileStream); if (_dbaseFileStream.Length > 0) { _header = DbaseHeader.ParseDbfHeader(_dbaseReader); _schema = DbaseSchema.GetFeatureTableForFields(_header.Columns); } }
public DbaseWriter(FileStream file, DbaseField[] fields) { _dbaseFileStream = file; _dbaseWriter = new BinaryWriter(_dbaseFileStream, Encoding.ASCII); if (file.CanRead) { _dbaseReader = new BinaryReader(_dbaseFileStream); } _header.Columns = fields; _schema = DbaseSchema.GetFeatureTableForFields(fields); writeFullHeader(); }