Ejemplo n.º 1
0
 public static void writeTo(IndentingWriter writer, long val) throws IOException {
   if (val < 0) {
     writer.write("-0x");
     writer.printLongAsHex(-val);
     writer.write('L');
   } else {
     writer.write("0x");
     writer.printLongAsHex(val);
     writer.write('L');
   }
 }
Ejemplo n.º 2
0
 public static void writeSignedIntOrLongTo(IndentingWriter writer, long val) throws IOException {
   if (val < 0) {
     writer.write("-0x");
     writer.printLongAsHex(-val);
     if (val < Integer.MIN_VALUE) {
       writer.write('L');
     }
   } else {
     writer.write("0x");
     writer.printLongAsHex(val);
     if (val > Integer.MAX_VALUE) {
       writer.write('L');
     }
   }
 }