public class ChunkHeader{ public uint Size = 0; public ChunkType Type = ChunkType.Unknown; public uint Version = 0; private void Read(BinaryReader fileAccess) { Type = (ChunkType)fileAccess.ReadUInt32(); Size = fileAccess.ReadUInt32(); Version = fileAccess.ReadUInt32(); } private void Write(BinaryWriter fileAccess) { fileAccess.Write((uint)Type); fileAccess.Write(Size); fileAccess.Write(Version); }...}
public interface IBinaryReadWrite{ public void Read(BinaryReader binaryReader); public void Write(BinaryWriter binaryWriter);}