Updated for changes in ReadStream and WriteStream