public static int sizeOf ( String typeDescriptor ) { if ( typeDescriptor . length ( ) != 1 ) { return 1 ; } char ch = typeDescriptor . charAt ( 0 ) ; if ( ch == ' ' || ch == ' ' ) { return 2 ; } else { return 1 ; } }
Return the size of a type . The size is usually 1 except for double and long which are of size 2 . The descriptor passed in is the full descriptor including any leading L and trailing ; .