I want store a list of doubles and ints to a ByteBuffer, which asks for a size to allocate. I\'d like to write something like C\'s syntax
int size=numDouble*size
Since Java 8, all wrapper classes of primitive types (except Boolean) have a BYTES field. So in your case:
Boolean
BYTES
int size = numDouble * Double.BYTES + numInt * Integer.BYTES;
Documentation: http://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html