public static long componentSize(Class<?> type){
  if (!type.isPrimitive()) {
switch (JVM_ARCH) {
case 32:
      return 4;
case 64:
    return 8;
}
}
int componentSize;
if (type == boolean.class || type == byte.class) {
componentSize=1;
}
 else if (type == char.class || type == short.class) {
componentSize=2;
}
 else if (type == int.class || type == float.class) {
componentSize=4;
}
 else if (type == long.class || type == double.class) {
componentSize=8;
}
 else {
componentSize=-1;
}
return componentSize;
}

public static long componentSize ( Class < ? > type ) { if ( ! type . isPrimitive ( ) ) { switch ( JVM_ARCH ) { case 32 : return 4 ; case 64 : return 8 ; } } int componentSize ; if ( type == boolean . class || type == byte . class ) { componentSize = 1 ; } else if ( type == char . class || type == short . class ) { componentSize = 2 ; } else if ( type == int . class || type == float . class ) { componentSize = 4 ; } else if ( type == long . class || type == double . class ) { componentSize = 8 ; } else { componentSize = - 1 ; } return componentSize ; }
returns the size of the type that is passed to this method . primitive types return their according size , in bytes , and objects return four bytes ( for the reference )
