There is one very serious problem with this function: it is solving a standard problem that has available solutions. In short, it is re-inventing the wheel.
Well, I'm making an assumption here. I'm assuming that the reason for reversing the integer is to convert from little-endian to big-endian or vice versa. The usual reason for this is that you are on a little-endian computer (any Intel or AMD x86 chip) and you need to send ore receive data from a network in "network order", i.e. big-endian.
If I am correct in my assumption, in C you can call one of:
ntohl()
hlton()
More info on these functions here:
http://www.codeguru.com/forum/showthread.php?t=298741
If you are already on a big-endian computer, and you want to reverse the integer for some other reason, then these calls won't help you (because "network order" is big-endian, so if you are already on a big-endian computer, hlton()
will not change anything).
I did a Google search for "Java ntohl" and found these links:
http://www.velocityreviews.com/forums/t139571-ntohl-ntohs-etc.html
http://www.coderanch.com/t/366549/Java-General/java/Java-equivilent-c-functions-htonl
So, I think you may not need to port this at all; you can perhaps just grab a solution from one of these two links.