String className = t.getClass().getSimpleName();
int n = 0;
if (className.equals("Byte")) {
n = 1;
} else if (className.equals("Short")) {
n = 2;
} else if (className.equals("Integer")) {
n = 4;
} else if (className.equals("Long")) {
n = 8;
} else if (className.equals("Float")) {
n = 4;
} else if (className.equals("Double")) {
n = 8;
} else if (className.equals("Boolean")) {
n = 0;
} else if (className.equals("Character")) {
n = 2;
}