字节流的序列化


            byte[] bts = System.Text.Encoding.Default.GetBytes("字符串");
            //bytes 2 base64
            string base64 = Convert.ToBase64String(bts);
            //Console.WriteLine(base64);
            //base64 2 bytes
            var newbts=Convert.FromBase64String(base64);
            string r = Encoding.Default.GetString(newbts);
            Console.WriteLine(r);
posted @ 2021-09-15 17:11  supersdar  阅读(55)  评论(0编辑  收藏  举报