[Paraview] Binary file read

Thomas Svedberg Thomas.Svedberg at me.chalmers.se
Thu Apr 28 08:13:17 EDT 2005


I've finally had time to look at this (long train journey) and with the 
help of some of the files you nice people sent me (and the VTK source 
code) been able to write binary XML files of different flavours.
So here is what I found out:
Raw format binary can only be appended, base64 encoded works both inline 
and appended.
Noncompressed data has the format |Header|data| where Header is unsigned 
int 32 bits wide (call it uint32) containing the data size (bytes).
If encoded, all is encoded in one go.

Compressed data has the format |Header2|data| where Header now is a 
struct {uint32 blocks; uint32 blocksize; uint32 last_blocksize; uint32 
compressed_blocksizes[];};
For me the following simplification works:
struct {uint32 1; uint32 total_datasize; uint32 total_datasize;; uint32 
compressed_datasize;};
If encoded, _the_header_and_the_data_is_encoded_sepparately!

I'm glad to help with more info if someone needs it.
-- 
/ Thomas
.......................................................................
  Thomas Svedberg
  Department of Applied Mechanics
  Chalmers University of Technology

  Address: SE-412 96 Göteborg, SWEDEN
  E-mail : Thomas.Svedberg at me.chalmers.se, thsv at chalmers.se, 
thsv at bigfoot.com
  Phone  : +46 31 772 1522
  Fax    : +46 31 772 3827
.......................................................................




More information about the ParaView mailing list