I'm new to C # TPL and DataFlow, and I'm struggling to figure out how to implement the TPL DataFlow TransformManyBlock . I am translating another code into DataFlow. My (simplified) source code was something like this:
private IEnumerable<byte[]> ExtractFromByteStream(Byte[] byteStream) { yield return byteStream;
And in another method, I would call it like this:
foreach (byte[] myByteArray in ExtractFromByteStream(byteStream)) {
I am trying to create a TransformManyBlock to create several small arrays (actually data packets) that come from a larger input array (actually a binary stream), so both inputs and outputs are of type byte[] .
I tried what I put below, but I know that everything worked out for me. I want to build this block using the same function as before, and just wrap TransformManyBlock around it. I got the error message "The call is ambiguous ..."
var streamTransformManyBlock = new TransformManyBlock<byte[], byte[]>(ExtractFromByteStream);
source share