code: public void writeHeader() throws IOException {
      if (byteOrder == ByteOrder.LITTLE_ENDIAN) {
        data.put((byte) 'I');
        data.put((byte) 'I');
      } else if (byteOrder == ByteOrder.BIG_ENDIAN) {
        data.put((byte) 'M');
        data.put((byte) 'M');
      }
  
      data.putShort((short) 42);
    }
docs: Writes the header.
  
  @throws IOException Signals that an I/O exception has occurred.