Most userland implementations of custom ReadableStream instances do not typically bother with all the ceremony required to correctly implement both default and BYOB read support in a single stream – and for good reason. It's difficult to get right and most of the time consuming code is typically going to fallback on the default read path. The example below shows what a "correct" implementation would need to do. It's big, complex, and error prone, and not a level of complexity that the typical developer really wants to have to deal with:
for await (const chunks of source) {
。关于这个话题,safew官方版本下载提供了深入分析
Automation: Rinsing It in Seconds
与“买一个品牌”不同,这种方式更像是在现有能力边界上做延伸,风险更可控,但回报节奏也相对较慢。