title: Is there a Java library for unsigned number type wrappers?
body: <p>Obviously, Java doesn't support unsigned number types natively, <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4504839" rel="nofollow noreferrer">and that's not going to change soon</a> (comments starting in 2002). However, when working with databases, such as MySQL, they may come in handy every now and then. There are a lot of questions dealing with how to simulate unsigned numbers. For example:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/1841461/unsigned-short-in-java">unsigned short in java</a></li>
  <li><a href="https://stackoverflow.com/questions/1540000/java-unsigned-numbers">Java: Unsigned numbers</a></li>
  <li><a href="https://stackoverflow.com/questions/3388204/understanding-java-unsigned-numbers">Understanding Java unsigned numbers</a></li>
  </ul>
  
  <p>All of them superficially describe how it <em>could</em> be done. But is there any library actually going all the way and implementing suitable wrappers for <code>UByte</code>, <code>UShort</code>, <code>UInteger</code>, <code>ULong</code>? Preferably, those wrappers would extend <code>java.lang.Number</code> and provide an arithmetic API similar to that of <code>java.math.BigInteger</code>.</p>
  
  <p>As can be seen in <a href="http://mindprod.com/jgloss/unsigned.html" rel="nofollow noreferrer">this document</a>, there's a lot to think of, and a lot that can go wrong (e.g. how to bitwise shift, how to multiply, etc), so I don't want to do it myself. Also, I don't want to just use the next higher type (e.g. <code>Short</code> instead of <code>Byte</code>, etc.). I want the notion of an <code>8-bit</code>, <code>16-bit</code>, <code>32-bit</code>, <code>64-bit</code> number preserved, for best interaction with databases, for instance.</p>
  
  <p><strong>UPDATE</strong>:</p>
  
  <p>Before you answer! Consider that I know all the workarounds, but I'd really really like to have exactly those 4 types with exactly the above properties. And maybe someone has already done that, so that's why I ask. No need to remind me of the workarounds.</p>