[vtk-developers] XML readers/writers with user streams

Brad King brad.king at kitware.com
Fri Jun 29 09:47:14 EDT 2007


Goodwin Lawlor wrote:
> Reading through vtkXMLWriter/vtkXMLReader its looks like they were coded
> to allow the reading and writing of datasets to/from a user stream
> instead of to/from disk.
> 
> Was there any method to do this envisioned originally?

Yes, but there is no official support for this currently.  It was
briefly investigated when the writers/readers were first written.  The
problem was that some string stream implementations seem to truncate the
stream if one seeks back to overwrite a few bytes.  The default
AppendedData mode breaks with this behavior.  If you use
SetDataModeToBinary it may work because the data will be written inline
as base64-encoded data so no seeks will occur (I think).

IIRC, only small changes to the interface are needed to enable using a
string stream.  I cannot remember whether there were other problems though.

-Brad



More information about the vtk-developers mailing list