stream-contents on decoder is much faster implemented using a read1 loop than with the default implementation.
] [ (finish-read) ] if*
] if ; inline recursive
-M: decoder stream-read-unsafe ( n buf decoder -- count )
+M: decoder stream-read-unsafe
pick 0 = [ 3drop 0 ] [
(read-first) [
0 (store-read)
] [ 2drop 2drop 0 ] if*
] if ; inline
+M: decoder stream-contents
+ (stream-contents-by-element) ;
+
: line-ends/eof ( stream str -- str ) f like swap cr- ; inline
: line-ends\r ( stream str -- str ) swap cr+ ; inline