Archive for the ‘Under The Hood’ Category

Understanding the primitive numeric type conversions in Java

Tuesday, October 21st, 2008

How difficult is to convert from long number to integer (int) in Java? Seems very simple - just do "(int)" and that’s all. How many times we blamed the irresponsible API designers using int type for the timeout value (in milliseconds) here and long value in other places, and so on? This subject is very [...]

Understanding host name resolution and DNS behavior in Java

Thursday, May 22nd, 2008

What can be simpler than resolving a host name to IP address? Whoever asks this question probably does not fully understand the details of the name resolution process. Want a quiz? Just think about the host called "256.1.2.3". OK, we can go quite far if we continue this way. This article is about getting [...]

Hidden costs of using Java String methods

Friday, October 5th, 2007

What can be easier than to replace a fragment of a string with another fragment in Java? Right, this sounds extremely simple. But, as it frequently happens, it turns out to be not that simple. Especially if you imagine that you need to perform the same replacement hundreds of thousands times in row. Like with [...]