io: non-copying binary stream read generics
Add generics stream-read-unsafe and stream-read-partial-unsafe, which take a buffer pointer and return a count of bytes read instead of returning a freshly allocated byte array.db4
parent
fde782cff6
commit
ef8a179f34
|
@ -9,8 +9,10 @@ SYMBOLS: +byte+ +character+ ;
|
||||||
GENERIC: stream-element-type ( stream -- type )
|
GENERIC: stream-element-type ( stream -- type )
|
||||||
|
|
||||||
GENERIC: stream-read1 ( stream -- elt )
|
GENERIC: stream-read1 ( stream -- elt )
|
||||||
|
GENERIC: stream-read-unsafe ( n buf stream -- n' )
|
||||||
GENERIC: stream-read ( n stream -- seq )
|
GENERIC: stream-read ( n stream -- seq )
|
||||||
GENERIC: stream-read-until ( seps stream -- seq sep/f )
|
GENERIC: stream-read-until ( seps stream -- seq sep/f )
|
||||||
|
GENERIC: stream-read-partial-unsafe ( n buf stream -- n' )
|
||||||
GENERIC: stream-read-partial ( n stream -- seq )
|
GENERIC: stream-read-partial ( n stream -- seq )
|
||||||
GENERIC: stream-readln ( stream -- str/f )
|
GENERIC: stream-readln ( stream -- str/f )
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue