A slight difference from regular ranges is you can give it the maximum number of bytes to consume.
IMPORTANT NOTE: the default is to consume nothing, so if you don't call consume() yourself and use a regular foreach, it will infinitely loop!
The default is to do what a normal range does, and consume the whole buffer and wait for additional input.
You can also specify 0, to append to the buffer, or any other number to remove the front n bytes and wait for more.
See Implementation
A slight difference from regular ranges is you can give it the maximum number of bytes to consume.
IMPORTANT NOTE: the default is to consume nothing, so if you don't call consume() yourself and use a regular foreach, it will infinitely loop!
The default is to do what a normal range does, and consume the whole buffer and wait for additional input.
You can also specify 0, to append to the buffer, or any other number to remove the front n bytes and wait for more.