static public int size ( DapType type ) { switch ( type . getTypeSort ( ) ) { case Char : // remember serial size is 1, not 2. case UInt8 : case Int8 : return 1 ; case Int16 : case UInt16 : return 2 ; case Int32 : case UInt32 : case Float32 : return 4 ; case Int64 : case UInt64 : case Float64 : return 8 ; case Enum : return size ( ( ( DapEnumeration ) type ) . getBaseType ( ) ) ; default : break ; } return 0 ; }
Conmpute the size in databuffer of the daptype wrt to a serialization ; 0 if undefined .