- Timestamp:
- 06/12/13 10:58:06 (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/fitsCompressor.cc
r16809 r16810 461 461 uint32_t numRows; 462 462 uint64_t size; 463 TileHeader(uint32_t nRows=0, uint64_t s=0) 464 { 465 id[0]='T'; 466 id[1]='I'; 467 id[2]='L'; 468 id[3]='E'; 469 numRows=nRows; 470 size=s; 471 }; 463 TileHeader(uint32_t nRows=0, 464 uint64_t s=0) : id({'T', 'I', 'L', 'E'}), 465 numRows(nRows), 466 size(s) 467 { }; 472 468 } __attribute__((__packed__)) TileHeader; 473 469 -
trunk/Mars/mcore/zfits.h
r16669 r16810 79 79 80 80 private: 81 typedef struct TileHeader 82 { 83 char id[4]; 84 uint32_t numRows; 85 uint64_t size; 86 TileHeader(uint32_t nRows=0, 87 uint64_t s=0) : id({'T', 'I', 'L', 'E'}), 88 numRows(nRows), 89 size(s) 90 { }; 91 friend ostream& operator << (ostream& out, const TileHeader& h) 92 { 93 out << h.id[0] << h.id[1] << h.id[2] << h.id[3] << " num Rows: " << h.numRows << ", tile size: " << h.size; 94 return out; 95 } 96 } __attribute__((__packed__)) TileHeader; 81 97 82 98 // Do what it takes to initialize the compressed structured … … 224 240 225 241 //skip to the beginning of the tile 226 seekg(fHeapOff+fCatalog[requestedTile][0].second); 242 seekg(fHeapOff+fCatalog[requestedTile][0].second - sizeof(TileHeader)); 243 TileHeader tHead; 244 read((char*)(&tHead), sizeof(TileHeader)); 245 cout << tHead << endl; 246 // seekg(fHeapOff+fCatalog[requestedTile][0].second); 227 247 read(fCompressedBuffer.data(), sizeToRead); 228 248 … … 231 251 fCopy.good()) 232 252 { 253 fCopy.write((char*)(&tHead), sizeof(TileHeader)); 233 254 fCopy.write(fCompressedBuffer.data(), sizeToRead); 234 255 if (!fCopy)
Note:
See TracChangeset
for help on using the changeset viewer.