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