code: public void writeObjectId(ObjectId objectId) throws IOException {
  		_writeArrayFieldNameIfNeeded();
  		_verifyValueWrite("write datetime");
  		_buffer.putByte(_typeMarker, BsonConstants.TYPE_OBJECTID);
  		// ObjectIds have their byte order flipped
  		int time = ByteOrderUtil.flip(objectId.getTime());
  		int machine = ByteOrderUtil.flip(objectId.getMachine());
  		int inc = ByteOrderUtil.flip(objectId.getInc());
  		_buffer.putInt(time);
  		_buffer.putInt(machine);
  		_buffer.putInt(inc);
  		flushBuffer();
  	}
docs: Write a BSON ObjectId
  
  @param objectId The objectId to write
  @throws IOException If an error occurred in the stream while writing