thank you very much Niall it works, Ken
--- Niall Gallagher <[EMAIL PROTECTED]> wrote: > Hi > > Whoops! Sorry about that, it should have been AND > with 0xff > and not 0x00, it was early!! > > byte num[4] = // whatever > > int bigE = ((num[0] & 0xff) > | ((num[1] & 0xff) << 8) > | ((num[2] & 0xff) << 16) > | ((num[3] & 0xff) << 24)); > > > Or this, whatever big endian is ... try em both > > int bigE = ((num[3] & 0xff) > | ((num[2] & 0xff) << 8) > | ((num[1] & 0xff) << 16) > | ((num[0] & 0xff) << 24)); > > > This definetly works for 8-bit binary data > represented as an array of 4 for a 32-bit int. > > Niall > > ___________________________________________________________________________ > To unsubscribe, send email to [EMAIL PROTECTED] > and include in the body > of the message "signoff SERVLET-INTEREST". > > Archives: > http://archives.java.sun.com/archives/servlet-interest.html > Resources: > http://java.sun.com/products/servlet/external-resources.html > LISTSERV Help: > http://www.lsoft.com/manuals/user/user.html > __________________________________ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
