Hello,
I'm trying to read data from a binary file with multiple resources that each have their own header, containing the distance to the next resource header as well as a uInt32 that needs to be read. My question is this: is it possible to read data from each resource header, keeping in mind that since this is a file type in general, and the distance to the next resource will be different for each file or resource that the user opens.
Thanks in advance.
Loading
JarrodPosted Oct 31, 2005, 11:54 PM
[StructLayout(LayoutKind.Sequential, Pack=1)]
public struct keyBiffRes{
public string sResName; public ushort usResType; public uint uBifResId; public static keyBiffRes Read(BinaryReader readKey, int nOffset){
keyBiffRes stKeyBiffRes =
new keyBiffRes();readKey.BaseStream.Position = nOffset;
stKeyBiffRes.sResName =
new String(readKey.ReadChars(16));stKeyBiffRes.usResType = readKey.ReadUInt16();
stKeyBiffRes.uBifResId = readKey.ReadUInt32();
return stKeyBiffRes;}
}
Thanks in advance.