Closed fallenoak closed 6 years ago
@timkurvers Now that I'm thinking of it, pipe()
potentially isn't super useful in its current form. It really should yield control back to the main event loop on each chunk. I'll have to ponder a bit more about this, since there's no async FS operations in StormLib
.
Rewriting to properly use stream.Readable
!
👍
This implements two forms of file reading:
pipe()
pipes the file in 128KB chunks into a writable stream; useful to prevent allocating large chunks of memory when reading bigger filesread()
returns aUint8Array
containing the entire file; use of the array after a file is closed is dangerousCloses #6