public static bool deserialize(string srcFile, string destFile, string md5String) { File.Create(destFile); //file to string //string to byte string sfile = File.ReadAllText(srcFile, Encoding.Default); //md5 if (!CheckSum.verifyMd5Hash(sfile, md5String.Trim())) { return(false); } byte[] buf = Encoding.Default.GetBytes(sfile); //byte to file (without last postfix) ByteArrayToFile(destFile, buf); return(true); }