code: private static void writeUtf16Bom(OutputStream stream, boolean bigEndian) throws IOException {
          if (bigEndian) {
              stream.write(-2);
              stream.write(-1);
          } else {
              stream.write(-1);
              stream.write(-2);
          }
      }
docs: Write a Byte Order Mark at the beginning of the file
  
  @param stream    the FileOutputStream to write the BOM to
  @param bigEndian true if UTF 16 Big Endian or false if Low Endian
  @throws IOException if an IOException occurs.
  @since 1.0