【作为】的意思是,导出的数据内存实际上依旧是IByteBlock生命周期内的,不能脱离生命周期使用。
public static ArraySegment<byte> AsSegmentTake<TByteBlock>(
this TByteBlock byteBlock,
int length
)
where TByteBlock : IByteBlock
<ExtensionAttribute>
Public Shared Function AsSegmentTake(Of TByteBlock As IByteBlock) (
byteBlock As TByteBlock,
length As Integer
) As ArraySegment(Of Byte)
[<ExtensionAttribute>]
static member AsSegmentTake :
byteBlock : 'TByteBlock *
length : int -> ArraySegment<byte> when 'TByteBlock : IByteBlock