add encoding settings to getWriter and getReader methods