public static int calculateFixLengthPartSize ( InternalType type ) { if ( type . equals ( InternalTypes . BOOLEAN ) ) { return 1 ; } else if ( type . equals ( InternalTypes . BYTE ) ) { return 1 ; } else if ( type . equals ( InternalTypes . SHORT ) ) { return 2 ; } else if ( type . equals ( InternalTypes . INT ) ) { return 4 ; } else if ( type . equals ( InternalTypes . FLOAT ) ) { return 4 ; } else if ( type . equals ( InternalTypes . CHAR ) ) { return 2 ; } else if ( type . equals ( InternalTypes . DATE ) ) { return 4 ; } else if ( type . equals ( InternalTypes . TIME ) ) { return 4 ; } else { // long, double is 8 bytes. // It store the length and offset of variable-length part when type is string, map, etc. return 8 ; } }
It store real value when type is primitive . It store the length and offset of variable - length part when type is string map etc .