Paste: read-record

Author: brennanc
Mode: factor
Date: Fri, 14 May 2010 00:10:09
Plain Text |
! read either a 1 byte or 4 byte big endian integer                                                                                    
: read-var-int ( -- n )
    1 read first dup 7 bit?
    [ 127 bitand 3 read swap suffix be> ]
    when ;

: read-name-value-pair ( -- name value )
    read-var-int read-var-int [ read >string ] bi@ ;

New Annotation

Summary:
Author:
Mode:
Body: