Dear James Gosling

Nov 12, 2008 19:51


Is unsigned really too much to ask?

jebusphone, snark, !kosher

Leave a comment

Comments 3

echristo November 13 2008, 19:24:30 UTC
hehehe. i've said that a few times as well. you can (annoyingly) get it by a) using bytes and hoping you only need 16 bits, or b) using a type that's greater than what you want and hoping you get the math right.

*sigh*

Reply

Damn Joethorntonrobblakejamesgoslingleaf conspiracy tague November 13 2008, 23:46:46 UTC
Actually that doesn't wor for my problem.

I'm trying to read in data packets from the network. The packets have a 4-byte type code, a 4-byte length code, followed by a variable length byte-buffer of message-y goodness.

Now here's the rub, byte arrays in Java can only be indexed using an integer, so if the client starts to be a chatty-cathy I'm screwed. (Okay, I'm probably exceptionally unhappy if I need 32-bits of length, but still...)

It's not like I'm trying to create a cherry-flavored maglev goat here. For someone who keeps telling us the network is the computer, they damn well forgot about all these 4-byte unsigned ints floating around on the damn intrawebz.

Reply

Re: Damn Joethorntonrobblakejamesgoslingleaf conspiracy echristo November 13 2008, 23:49:48 UTC
I think this might work - still, annoying.

http://darksleep.com/player/JavaAndUnsignedTypes.html

Reply


Leave a comment

Up