Originally posted by kha nguyen: Can buffer overflow in a Java/J2EE-Application occur? Should we actively take it to consideration designing a J2EE-based apllication?
Thank you in advance, Kha Nguyen
Hi Kha, the short answer is yes, it 'can' occur. When it does, it is considered a system level error and there is nothing you can directly do. (Because it extends RuntimeException).
Go here "http://java.sun.com/javase/6/docs/api/" to see a list of all Java clases available in Java6 SE edition. Somewhere down the list, is a class called BufferOverflowException, in the java.nio package. (Also possible, is a BufferUnderflowException as well).
These are both class extensions of the more generic RuntimeException class, which Java programs (and consequently J2EE programs) do not need to explicitly catch in their try-catch blocks. So, technically, you do not explicitly need to design for their occurrence. You do need some sort of behavior for RuntimeExceptions in general, though. (Even if that is simply that the runtime exception bubbles up to the main() method call and the program exits).
But this question doesn't belong in the SCEA forum. It is a Java language specific question, I believe. Thanks, -jeff
Come have lunch with me Arthur. Adventure will follow. This tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop