code: public static void writeU2(OutputStream dest, int u2) throws IOException {
          if ((u2 < Character.MIN_VALUE) || (u2 > Character.MAX_VALUE)) {
              throw new IllegalArgumentException();
          }
          dest.write((byte) (u2 >> 8));
          dest.write((byte) u2);
      }
docs: int c  simplifies checking, casting