35 Encoding encoding =
null,
int max_queue_size = 3)
36 : base(max_queue_size)
47 if (!_source.IsRunning)
63 if (!success)
return false;
Converts buffered bytes to strings.
int ByteLength
The UTF8-Encoded byte length of the string.
string String
The value of the string.
static readonly Encoding DEFAULT_ENCODING
The default encoding used if none is supplied at construction.
BufferedBytesToStringProducer(IProducerConsumerBuffer< BufferedBytes > source, Encoding encoding=null, int max_queue_size=3)
Construct a producer of strings from buffered bytes.
Encoding Encoding
The encoding to use when producing the strings.
override void OnStart()
Invoked before the producer thread is started.
override bool TryProduceNext(out StringWithByteCount next)
Encode the next string.
override bool IsProducerFinished()
Indicates whether it can produce more items.
A tuple containing a string and its UTF8 bytes count.
Base class that consumes from a source asynchronously and produces a queue of some other resource to ...
CancellationTokenSource Cancellation
Can be used to cancel the buffering process.
Interface for a class that consumes from a source asynchronously and produces a queue of some other r...
byte[] Bytes
The buffer of bytes filled.
int LengthFilled
The actual length of bytes, which may be shorter.
The structure containing an array of bytes and integer indicating the number of bytes in the array th...