示例#1
0
 public static void WritePK6(PK6 pk6, String FileName)
 {
     byte[] data = Serializer.RawSerialize(pk6);
     using (FileStream fs = new FileStream(FileName, FileMode.Create, FileAccess.Write))
     {
         using (BinaryWriter bw = new BinaryWriter(fs))
         {
             bw.Write(data, 0, 0xE8);
             bw.Close();
             fs.Close();
         }
     }
 }
示例#2
0
        public static PK6 ReadPK6(String FileName)
        {
            PK6 pk6 = new PK6();

            byte[] data;
            using (FileStream fs = new FileStream(FileName, FileMode.Open, FileAccess.Read))
            {
                using (BinaryReader br = new BinaryReader(fs))
                {
                    data = br.ReadBytes((int)fs.Length);
                    br.Close();
                    fs.Close();
                }
            }
            pk6 = (PK6)(PKMDS.Serializer.RawDeserialize(data, typeof(PK6)));
            return(pk6);
        }