changed stream>assoc to return the amount of bytes read from the stream
parent
fa8aa747b9
commit
f588143082
|
@ -194,13 +194,7 @@ M: bson-binary-function element-binary-read ( size type -- quot )
|
|||
|
||||
PRIVATE>
|
||||
|
||||
: stream>assoc ( exemplar -- assoc )
|
||||
: stream>assoc ( exemplar -- assoc bytes-read )
|
||||
<state> dup state
|
||||
[ read-int32 >>size read-elements ] with-variable
|
||||
result>> ;
|
||||
|
||||
: array>assoc ( array exemplar -- assoc )
|
||||
[ binary ] dip '[ _ stream>assoc ] with-byte-reader ;
|
||||
|
||||
: array>hashtable ( array -- assoc )
|
||||
H{ } array>assoc ;
|
||||
[ read-int32 >>size read-elements ] with-variable
|
||||
[ result>> ] [ read>> ] bi ;
|
||||
|
|
Loading…
Reference in New Issue