public PacFileHandling(BinaryReader b) { pacFile = new Pac(); pacStream = b; pacFile.header = ReadHeader(); PacDirParse dirParse = new PacDirParse(pacStream, pacFile); PACHParser pachParse = new PACHParser(); TextureParser textureParse = new TextureParser(); if (pacFile.header.id == "PACH") { //You opened a free floating PACH file~! pacStream.BaseStream.Position = 0; pacFile.container = pachParse.ReadPACHContainer(pacStream.ReadBytes((int)pacStream.BaseStream.Length)); } else if (pacFile.header.id == "EPK8" || pacFile.header.id == "EPAC") { pacFile.dir = dirParse.ReadDir().ToArray(); } else { //probably a texture archive... //pacFile.header.id = "Texture Archive"; pacStream.BaseStream.Position = 0; pacFile.textures = textureParse.ReadTextures(pacStream); } }