Example #1
0
 public static Number toWrapper(int i) {
   if (i >= Byte.MIN_VALUE && i <= Byte.MAX_VALUE) {
     return Byte.valueOf((byte) i);
   } else if (i >= Short.MIN_VALUE && i <= Short.MAX_VALUE) {
     return Short.valueOf((short) i);
   } else {
     return Integer.valueOf(i);
   }
 }
Example #2
0
 public static Object wrapAsObject(byte i) {
   return Byte.valueOf(i);
 }