 
 PRIVATE>
 
-M: input-port stream-read-until ( seps port -- byte-array/f sep/f )
+M: input-port stream-read-until
     2dup read-until-step dup [ [ 2drop ] 2dip ] [
         over [
             drop

    n-remaining port read-step :> ( n-buffered ptr )
    ptr [
        dst ptr n-buffered memcpy
        n-remaining n-buffered - :> n-remaining'
        n-read n-buffered + :> n-read'
        n-buffered dst <displaced-alien> :> dst'
        dst' n-remaining' port n-read' read-loop
    ] [ n-read ] if ; inline recursive

! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien byte-arrays combinators destructors hints
io io.backend io.buffers io.encodings io.files io.timeouts
kernel kernel.private libc locals math math.order math.private
namespaces sequences strings system ;
IN: io.ports

SYMBOL: default-buffer-size
