     ] unless-zero ; inline
 
 : write-ascii ( from to bytes stream -- )
-    '[ [ printable? ] keep CHAR: . ? _ stream-write1 ] each-byte ; inline
+    dup stream-bl '[
+        [ printable? ] keep CHAR: . ? _ stream-write1
+    ] each-byte ; inline
 
 TYPED: write-hex-line ( from: fixnum to: fixnum bytes: byte-array -- )
     line# write inc-line# output-stream get {

:: hexdump-bytes ( from to bytes -- )
    reset-line#
    to from - :> len
    len write-header
    len 16 /mod
    [ [ 16 * dup 16 + bytes write-hex-line ] each-integer ]
    [ [ len swap - len bytes write-hex-line ] unless-zero ] bi* ;

: hexdump-stream ( stream -- )
    reset-line#
    [ stream-length write-header ]
    [ [ all-bytes write-hex-line ] 16 (each-stream-block) ] bi ;

PRIVATE>



<PRIVATE

CONSTANT: line# "00000000  "

: inc-line# ( -- )
    7 [ CHAR: 0 = over 0 > and ] [
