I wrote a method to search the /etc/services file
(or /etc/inet/services or c:\winnt\system32\drivers\etc\services).
It is at <A HREF="http://www.dan.drydog.com/java/GetServiceByName.java</a rel="nofollow">" TARGET=_blank>http://www.dan.drydog.com/java/GetServiceByName.java
This isn't a part of Java because someone apparently thought
it's a system-dependent function.
With all due respect, this is not
function. The implementation may be (such as the location of
the /etc/services file or whether it's a flat file or database),
but the function can be implemented on any system.