This question already has an answer here:
(这个问题在这里已有答案:)
I created a byte array with two strings.
(我用两个字符串创建了一个字节数组。)
How do I convert a byte array to string? (如何将字节数组转换为字符串?)
var binWriter = new BinaryWriter(new MemoryStream());
binWriter.Write("value1");
binWriter.Write("value2");
binWriter.Seek(0, SeekOrigin.Begin);
byte[] result = reader.ReadBytes((int)binWriter.BaseStream.Length);
I want to convert result
to a string.
(我想将result
转换为字符串。)
I could do it using BinaryReader
, but I cannot use BinaryReader
(it is not supported). (我可以使用BinaryReader
,但我不能使用BinaryReader
(它不受支持)。)
ask by Oksana translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…