CTIEng2004
Technical User
Coming from a C/C++ background, I am still wondering why Java doesn't provide network byte order conversion routines like htonl(), nthol(), htons(), ntohs() etc. Seems like most Java apps I see use ASCII streams. But what if you have to interface w/ a legacy app that uses variable length packets w/ shorts and integers? Now you see my problem.
Writing these functions yourself is doable, but since you have to take into account the processor achitecture (big-endian versus little endian) and the fact they are used so heavily in potential real-time or near real-time scenarios, such routines can actually be fairly tricky and become inefficient.
I am wondering if someone has a very efficient Java routine or set of Java routines that perform network byte order and host byte order conversions?
Thanks
mike_luster@hotmail.com
Writing these functions yourself is doable, but since you have to take into account the processor achitecture (big-endian versus little endian) and the fact they are used so heavily in potential real-time or near real-time scenarios, such routines can actually be fairly tricky and become inefficient.
I am wondering if someone has a very efficient Java routine or set of Java routines that perform network byte order and host byte order conversions?
Thanks
mike_luster@hotmail.com