I found some code used as an example of how to get the time since 1900 and unsinged 32 bit number for implenting a time server.
Well it doesn't seem to work and this is the first time I have used bit wise operators before. Anyone spot the problem?
Joined: Aug 18, 2004
The bitwise operations are being performed correctly. You are probably expecting unsigned values in your time, but 'byte' is a signed integer. The bytes that have a '1' in the MSB are treated as negative numbers.
You could store the bytes in a short or int.
Joined: Aug 15, 2004
The only problem with this is it has to go into a ByteBuffer. I guess I could store it into a ShortBuffer though.
Edit: Yeah, I need a ByteBuffer so I need an array of bytes.