Any use of streams if all data fits in one piece?

When I do fs.createReadStreamin Node.js, the data seems to go into 64K chunks (I assume this depends on computers).

Let's say I lay the read stream through a series of transformations (each of which works on a single fragment), and then finally connect it to the write stream to save it to disk ...

If I know in advance that the files I'm working on are guaranteed to be less than 64 KB each (i.e., each of them will be read in one fragment), is there any use for using streams, unlike the plain old asynchronous the code?

+3
source share
1 answer

, , highWaterMark: 16k (16 ), fs.ReadStream - 64 . (. ).

, , . ,

, ; : , . , .

, , ...

, (.. readable ), , .

+5

All Articles