added method Writer::createAndWrite() with simplified interface