added write to iovec
implemented read from binary