Changing native read/write of trajectory to C++ streams.