【发布时间】:2013-07-24 21:59:26
【问题描述】:
给定特定的Encoding,有没有办法从IReadOnlyList<byte> 中获取字符串?
更准确地说,有没有办法在将集合的内容传递给 Encoding 对象之前不复制集合的内容?
我主要关心的是性能,其次是内存使用。
【问题讨论】:
-
如何更精确?
-
这个问题缺少什么?
-
也许有人可以解释一下,但我不明白你在追求什么。
is there a way that doesn't copy the content of the collection before passing it to the Encoding object?是什么意思? -
@I4V - 我认为他的意思是,他不想像 .ToArray() 那样将字节列表创建为数组的第二个可变副本。
-
@RJProgrammer 你可能是对的,那么答案是否定的。
标签: c# encoding readonly-collection