When will MemoryStream.TryGetBuffer return a useful ArraySegment?
问题 bool MemoryStream.TryGetBuffer(out ArraySegment<byte> buffer) is a new API in .NET 4.6 that can be used to get access to the valid bytes stored in the MemoryStream without copying them. This is very exciting! It returns a bool that is "true if the conversion was successful; otherwise, false" and populates the out param. When does it return true, indicating that the out ArraySegment<byte> buffer now contains valid information? This isn't documented today. I know that if it returns false, I can