]> gitweb.factorcode.org Git - factor.git/commit
io: stream-contents, -seekable?, -length generics
authorJoe Groff <arcata@gmail.com>
Sat, 15 Oct 2011 01:07:38 +0000 (18:07 -0700)
committerJoe Groff <arcata@gmail.com>
Tue, 18 Oct 2011 04:23:07 +0000 (21:23 -0700)
commit225d10b4ddee8601fc681461d2c837a50ddc1a0a
treeef2ae718986df43ae3405b1f01c9ee9f517eeb50
parentbd50acf4240d3f9d69c0a4fd9f244d7363491087
io: stream-contents, -seekable?, -length generics
stream-contents is extremely slow on decoder streams when implemented with each-block, and it can be implemented very quickly for streams of known length using stream-read-unsafe. Make it generic and provide some off-the-shelf implementations using each-block, a read1 loop, or length + read-unsafe. Provide new stream-seekable? and stream-length generics that can be implemented by stream implementations that know their size.
core/io/io.factor