News for hackers. Stuff that matters.
Re:Vulnerability in Microsoft TLS library could allow remote... by mike_hearn on Wednesday November 12, 2014 @06:06AM (#8594871)
I'm not aware of any intent on adding unsigned types in Java 9 though. The lack of them is a real PITA, for sure. Not only for performance but it's incredibly easy to forget a & 0xFF here or there and introduce bugs.

The MMAP thing is also a good point. I believe HotSpot will compile the get methods on the MappedByteBuffer down to raw access so it shouldn't matter much for performance, in theory, but the code is still damned ugly. I never understood why they can't expose it as a byte[].

Re:Vulnerability in Microsoft TLS library could allow remote... by pjmlp on Wednesday November 12, 2014 @07:22AM (#8595083)
> I'm not aware of any intent on adding unsigned types in Java 9 though.

You kind of have them in Java 8, but not as primitive type.

https://blogs.oracle.com/darcy/entry/unsigned_api

I also think a very least having ubyte would be quite nice.

Apparently the reason behind the decision has to do with overflows and underflows in unsigned arithmetic.

Hotspot is just one of many Java native compilers out there , so it is better not to rely on what Hotspot does.

On the other hand, you can make use of JIT Watch or Solaris Studio debugging to see what Assembly is being generated.

> I never understood why they can't expose it as a byte[].

Maybe the official unsafe class will make this better.