diff --git a/dBASE.NET/Dbf.cs b/dBASE.NET/Dbf.cs
index f4c9491..84c90a9 100644
--- a/dBASE.NET/Dbf.cs
+++ b/dBASE.NET/Dbf.cs
@@ -82,6 +82,20 @@ public void Read(string path)
}
}
+ ///
+ /// Opens a DBF file, reads only database description and fields descriptors, and then closes the file.
+ ///
+ /// The file to read.
+ public void ReadMetadata(string path)
+ {
+ using (FileStream stream = File.Open(path, FileMode.Open, FileAccess.Read))
+ using (BinaryReader reader = new BinaryReader(stream))
+ {
+ ReadHeader(reader);
+ ReadFields(reader);
+ }
+ }
+
///
/// Creates a new file, writes the current instance to the file, and then closes the file. If the target file already exists, it is overwritten.
///
@@ -142,7 +156,7 @@ private static byte[] ReadMemos(string path)
FileStream str = File.Open(memoPath, FileMode.Open, FileAccess.Read);
BinaryReader memoReader = new BinaryReader(str);
byte[] memoData = new byte[str.Length];
- memoData = memoReader.ReadBytes((int)str.Length);
+ memoReader.Read(memoData, 0, memoData.Length);
memoReader.Close();
str.Close();
return memoData;