日期:2014-05-17 浏览次数:21156 次
private int ReadFileInt32(FileStream fs, int offset)
{
return BitConverter.ToInt32(ReadFile(fs, offset, 4), 0);
}
private int ReadFileInt16(FileStream fs, int offset)
{
return BitConverter.ToInt16(ReadFile(fs, offset, 2), 0);
}
private byte[] ReadFile(FileStream fs, int offset, int n)
{
fs.Seek(offset, SeekOrigin.Begin);
byte[] data = new byte[n];
fs.Read(data, 0, n);
return data;
}