 
 : read-multipoint-m ( -- multipoint-m )
     read-box read-int
-    [ read-points read-range ] [ read-double-array ] bi
+    [ read-points read-range ] [ read-doubles ] bi
     multipoint-m boa ;
 
 TUPLE: polyline-m box parts points m-range m-array ;
 
 : read-polyline-m ( -- polyline-m )
-    read-box read-int read-int [ read-int-array ] dip
-    [ read-points read-range ] [ read-double-array ] bi
+    read-box read-int read-int [ read-ints ] dip
+    [ read-points read-range ] [ read-doubles ] bi
     polyline-m boa ;
 
 TUPLE: polygon-m box parts points m-range m-array ;
 
 : read-polygon-m ( -- polyline-m )
-    read-box read-int read-int [ read-int-array ] dip
-    [ read-points read-range ] [ read-double-array ] bi
+    read-box read-int read-int [ read-ints ] dip
+    [ read-points read-range ] [ read-doubles ] bi
     polygon-m boa ;
 
 TUPLE: point-z x y z m ;

: read-multipoint-z ( -- multipoint-z )
    read-box read-int
    [ read-points read-range ]
    [ read-double-array read-range ]
    [ read-double-array ] tri multipoint-z boa ;

TUPLE: polyline-z box parts points z-range z-array m-range
m-array ;

: read-polyline-z ( -- polyline-z )
    read-box read-int read-int [ read-int-array ] dip
    [ read-points read-range ]
    [ read-double-array read-range ]
    [ read-double-array ] tri polyline-z boa ;

TUPLE: polygon-z box parts points z-range z-array m-range
m-array ;

: read-polygon-z ( -- polyline-z )
    read-box read-int read-int [ read-int-array ] dip
    [ read-points read-range ]
    [ read-double-array read-range ]
    [ read-double-array ] tri polygon-z boa ;

TUPLE: multipatch box parts points part-types z-range z-array
m-range m-array ;

: read-multipatch ( -- multipatch )
    read-box read-int read-int
    [ [ read-int-array ] [ read-int-array ] bi ] dip
    [ read-points read-range ]
    [ read-double-array read-range ]
    [ read-double-array ] tri multipatch boa ;

: read-shape ( -- shape )
    4 read le> {

TUPLE: multipoint box points ;

: read-multipoint ( -- multipoint )
    read-box read-int read-points multipoint boa ;

TUPLE: polyline box parts points ;

: read-polyline ( -- polyline )
    read-box read-int read-int [ read-ints ] dip
    read-points polyline boa ;

TUPLE: polygon box parts points ;

: read-polygon ( -- polygon )
    read-box read-int read-int [ read-ints ] dip
    read-points polygon boa ;

TUPLE: point-m x y m ;

