Search the reference...
/
BuildDocsReferenceGuidesBlogDiscord/node:zlib/ZstdDecompress/readMreadmethod
zlib.ZstdDecompress.read { let chunk; console.log('Stream is readable (new data received in buffer)'); // Use a loop to make sure we read all currently available data while (null !== (chunk = readable.read())) { console.log(`Read ${chunk.length} bytes of data...`); } }); // 'end' will be triggered once when there is no more data available readable.on('end', () => { console.log('Reached end of stream.'); }); ``` Each call to `readable.read()` returns a chunk of data, or `null`. The chunks are not concatenated. A `while` loop is necessary to consume all data currently in the buffer. When reading a large file `.read()` may return `null`, having consumed all buffered content so far, but there is still more data to come not yet buffered. In this case a new `'readable'` event will be emitted when there is more data in the buffer. Finally the `'end'` event will be emitted when there is no more data to come. Therefore to read a file's whole contents from a `readable`, it is necessary to collect chunks across multiple `'readable'` events: ```js const chunks = []; readable.on('readable', () => { let chunk; while (null !== (chunk = readable.read())) { chunks.push(chunk); } }); readable.on('end', () => { const content = chunks.join(''); }); ``` A `Readable` stream in object mode will always return a single item from a call to `readable.read(size)`, regardless of the value of the `size` argument. If the `readable.read()` method returns a chunk of data, a `'data'` event will also be emitted. Calling read after the `'end'` event has been emitted will return `null`. No runtime error will be raised." data-algolia-static="false" data-algolia-merged="false" data-type="Method">read(size?: number): any;The readable.read() method reads data out of the internal buffer and returns it. If no data is available to be read, null is returned. By default, the data is returned as a Buffer object unless an encoding has been specified using the readable.setEncoding() method or the stream is operating in object mode.The optional size argument specifies a specific number of bytes to read. If size bytes are not available to be read, null will be returned unless the stream has ended, in which case all of the data remaining in the internal buffer will be returned.If the size argument is not specified, all of the data contained in the internal buffer will be returned.The size argument must be less than or equal to 1 GiB.The readable.read() method should only be called on Readable streams operating in paused mode. In flowing mode, readable.read() is called automatically until the internal buffer is fully drained.const readable = getReadableStreamSomehow(); // 'readable' may be triggered multiple times as data is buffered in readable.on('readable', () => { let chunk; console.log('Stream is readable (new data received in buffer)'); // Use a loop to make sure we read all currently available data while (null !== (chunk = readable.read())) { console.log(`Read ${chunk.length} bytes of data...`); } }); // 'end' will be triggered once when there is no more data available readable.on('end', () => { console.log('Reached end of stream.'); }); Each call to readable.read() returns a chunk of data, or null. The chunks are not concatenated. A while loop is necessary to consume all data currently in the buffer. When reading a large file .read() may return null, having consumed all buffered content so far, but there is still more data to come not yet buffered. In this case a new 'readable' event will be emitted when there is more data in the buffer. Finally the 'end' event will be emitted when there is no more data to come.Therefore to read a file's whole contents from a readable, it is necessary to collect chunks across multiple 'readable' events:const chunks = []; readable.on('readable', () => { let chunk; while (null !== (chunk = readable.read())) { chunks.push(chunk); } }); readable.on('end', () => { const content = chunks.join(''); }); A Readable stream in object mode will always return a single item from a call to readable.read(size), regardless of the value of the size argument.If the readable.read() method returns a chunk of data, a 'data' event will also be emitted.Calling read after the 'end' event has been emitted will return null. No runtime error will be raised.@param sizeOptional argument to specify how much data to read.Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlogToolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San FranciscoWe're hiring →智能索引记录
-
2026-03-02 18:14:23
综合导航
成功
标题:ibis Koeln Am Dom - 2-star hotel in Cologne
简介:Free services for HRS guests at the ibis Koeln Am Dom (Colog
-
2026-03-02 20:07:21
综合导航
成功
标题:Lessons, Homework Helper & Teaching Tools EDU.COM
简介:Explore engaging K-6 lessons, fun worksheets, homework helpe
-
2026-03-02 16:58:47
综合导航
成功
标题:The Renaissance of Decentralized Finance: Making DeFi Great Again Bee Network
简介:Original article by: Arthur Cheong, Eugene Yap Original tra
-
2026-03-02 17:15:13
综合导航
成功
标题:辨äºçæ¼é³_辨äºçææ_辨äºçç¹ä½_è¯ç»ç½
简介:è¯ç»ç½è¾¨äºé¢é,ä»ç»è¾¨äº,辨äºçæ¼é³,è¾¨äºæ¯
-
2026-03-02 22:20:12
综合导航
成功
标题:Drinker Biddle Expands into Texas with Arrival of 23 Lawyers in Dallas News About Faegre Drinker Biddle & Reath LLP
简介:Nine new partners join firm’s 12th office, bolstering
-
2026-03-02 17:37:02
综合导航
成功
标题:OST2 - a free OST to PST converter
简介:OST2 - Free OST to PST converter software recovery tool. Con
-
2026-03-02 17:18:46
综合导航
成功
标题:All jobs near Colorado in the Healthcare sector · GQR
简介:Job Search Page 1 - GQR
-
2026-03-02 18:39:27
教育培训
成功
标题:如何让兴趣变成最好的老师-上海新王牌
简介:不同成绩的学生通过方法的慢慢掌握来获得学英语的兴趣和自信,这样坚持一段时间,让学生看到自己做题上的改变,兴趣自然会变成最
-
2026-03-02 22:20:37
综合导航
成功
标题:ç¼ç®çæ¼é³_ç¼ç®çææ_ç¼ç®çç¹ä½_è¯ç»ç½
简介:è¯ç»ç½ç¼ç®é¢é,ä»ç»ç¼ç®,ç¼ç®çæ¼é³,ç¼ç®æ¯
-
2026-03-02 19:56:54
综合导航
成功
标题:18妖怪诊所甜甜最新章节_025 生殖隔离第1页_18妖怪诊所甜甜免费章节_恋上你看书网
简介:025 生殖隔离第1页_18妖怪诊所甜甜_甜甜T_恋上你看书网
-
2026-03-02 16:46:11
综合导航
成功
标题:Three Stars of the Night NHL.com
简介:Rasmus Dahlin (goal, 2 assists), Cole Caufield (2 goals), an
-
2026-03-02 21:08:49
综合导航
成功
标题:å¨å
¨çæ¼é³_å¨å
¨çææ_å¨å
¨çç¹ä½_è¯ç»ç½
简介:è¯ç»ç½å¨å ¨é¢é,ä»ç»å¨å ¨,å¨å ¨çæ¼é³,å¨å ¨æ¯
-
2026-03-02 18:07:21
综合导航
成功
标题:How mobile Network Operators use Tektronix Real-Time Spectrum Analyzer Tektronix
简介:Field service organizations for mobile communication of netw
-
2026-03-02 22:11:39
游戏娱乐
成功
标题:大富之家,大富之家小游戏,4399小游戏 www.4399.com
简介:大富之家在线玩,大富之家下载, 大富之家攻略秘籍.更多大富之家游戏尽在4399小游戏,好玩记得告诉你的朋友哦!
-
2026-03-02 17:00:19
综合导航
成功
标题:Must-watch next week Powell will deliver monetary policy report testimony in both houses of Congress; Bitcoin options Bee Network
简介:Next weeks highlights June 23 The governor of the Bank of
-
2026-03-02 17:51:55
综合导航
成功
标题:大éçæ¼é³_大éçææ_大éçç¹ä½_è¯ç»ç½
简介:è¯ç»ç½å¤§éé¢é,ä»ç»å¤§é,大éçæ¼é³,大鿝
-
2026-03-02 20:15:03
综合导航
成功
标题:使¬¡çæ¼é³_使¬¡çææ_使¬¡çç¹ä½_è¯ç»ç½
简介:è¯ç»ç½ä½æ¬¡é¢é,ä»ç»ä½æ¬¡,使¬¡çæ¼é³,使¬¡æ¯
-
2026-03-02 16:51:59
综合导航
成功
标题:Launched today, how much should WLFI be worth?Recommended Articles Bee Network
简介:After months of controversy and anticipation, WLFI finally r
-
2026-03-02 21:32:53
综合导航
成功
标题:èºéçæ¼é³_èºéçææ_èºéçç¹ä½_è¯ç»ç½
简介:è¯ç»ç½èºéé¢é,ä»ç»èºé,èºéçæ¼é³,èºéæ¯
-
2026-03-02 17:13:33
新闻资讯
成功
标题:网易
简介:网易是中国领先的互联网技术公司,为用户提供免费邮箱、游戏、搜索引擎服务,开设新闻、娱乐、体育等30多个内容频道,及博客、
-
2026-03-02 22:23:28
综合导航
成功
标题:笔趣阁_无弹窗广告小说免费阅读_最好看的小说阅读网
简介:笔趣阁致力于打造无广告无弹窗的在线小说阅读网站,提供小说在线阅读,小说TXT下载,网站没有弹窗广告页面简洁。
-
2026-03-02 16:53:44
综合导航
成功
标题:Bubble Defence - Free Online Game on 4J.com
简介:Bubble Defence is a free online game on 4j.Com. You can find
-
2026-03-02 22:26:14
电商商城
成功
标题:林瑞格预订订购价格 - 京东
简介:京东是国内专业的林瑞格网上购物商城,本频道提供林瑞格商品预订订购价格,林瑞格哪款好信息,为您选购林瑞格提供全方位订购价格
-
2026-03-02 21:30:47
综合导航
成功
标题:Reform of copyright exceptions - 5RB Barristers
简介:Reform of copyright exceptions - Intellectual Property, News
-
2026-03-02 16:59:50
综合导航
成功
标题:RIA.com - Купить продукты питания и напитки в Украине
简介:Различные продукты питания оптом и в розницу в Украине недор
-
2026-03-02 16:55:43
综合导航
成功
标题:SPA Australia Showcases Capabilities - SPA
简介:SPA Australia showcased the modeling, analysis, and decision
-
2026-03-02 20:05:14
游戏娱乐
成功
标题:动漫明星混战,动漫明星混战小游戏,4399小游戏 www.4399.com
简介:动漫明星混战在线玩,动漫明星混战下载, 动漫明星混战攻略秘籍.更多动漫明星混战游戏尽在4399小游戏,好玩记得告诉你的朋
-
2026-03-02 18:45:12
综合导航
成功
标题:被全家宠了最新章节_第20章 陷阱第1页_被全家宠了免费章节_恋上你看书网
简介:第20章 陷阱第1页_被全家宠了_年年穗岁_恋上你看书网
-
2026-03-02 18:46:20
综合导航
成功
标题:Soundness ELE International
简介:Calculate the soundness of cement with ELE International tes
-
2026-03-02 16:41:52
电商商城
成功
标题:皮雪花牛仔裤怎么样 - 京东
简介:京东是专业的皮雪花牛仔裤网上购物商城,为您提供皮雪花牛仔裤价格图片信息、皮雪花牛仔裤怎么样的用户评论、皮雪花牛仔裤精选导