Ejemplo n.º 1
0
        public sFolder Unpack(sFile file)
        {
            System.IO.BinaryReader br = new System.IO.BinaryReader(System.IO.File.OpenRead(file.path));
            string type = new String(Encoding.ASCII.GetChars(br.ReadBytes(4)));

            br.Close();
            if (type == "BB" + Convert.ToChar(0) + Convert.ToChar(0))
            {
                return(BB.Unpack(file.path, pluginHost));
            }

            return(new sFolder());
        }
Ejemplo n.º 2
0
        public string Pack(ref sFolder unpacked, sFile file)
        {
            System.IO.BinaryReader br = new System.IO.BinaryReader(System.IO.File.OpenRead(file.path));
            string type = new String(Encoding.ASCII.GetChars(br.ReadBytes(4)));

            br.Close();
            if (type == "BB" + Convert.ToChar(0) + Convert.ToChar(0))
            {
                String packFile = pluginHost.Get_TempFile();
                if (File.Exists(packFile))
                {
                    File.Delete(packFile);
                }

                BB.Pack(packFile, ref unpacked);
                return(packFile);
            }

            return(null);
        }