+
+ s16 = *((uint16_t *)(deb));
+ if (s16 != 0x0000)
+ return false;
+ s16 = *((uint16_t *)(deb+2));
+
+ Fp->seekg ( 0L, std::ios::beg); // Once per Document
+ CurrentOffsetPosition = 0;
+ switch(s16) // try an other trick!
+ // -> to be able to decode 0029|1010 DataElement
+ // -> and be not less cleaver than dcmdump ;-)
+ {
+ case 0x0004 :
+ SwapCode = 1234;
+ break;
+ case 0x0400 :
+ SwapCode = 3412;
+ break;
+ default:
+ gdcmWarningMacro("ACR/NEMA unfound swap info (Hopeless !)");
+ Filetype = Unknown;
+ return false;
+ }
+ // Check if next 2 bytes are a VR
+ // Probabely something more time-consuming exists with std::string
+ const char VRvalues[] = "AEASATCSDADTFLFDISLOLTPNSHSLSSSTTMUIULUSUTOBOWOFATUNSQRT";
+ int nbVal = 28;
+ const char *pt = VRvalues;
+ for (int i=0;i<nbVal;i++)
+ {
+ if(*(deb+4) == *pt++) {
+ if(*(deb+5) == *pt++) {
+ Filetype = ExplicitVR;
+ return true;
+ }
+ else {
+ pt++;
+ }
+ }
+ Filetype = ImplicitVR;
+ return true;