added options.encoding for writable streams