How to decode file after extracting it from annotation
I have the following code for extracting 3d data ( file ) from my annotation , but as the result I have encoded ( compressed ) file , how I can get the decoded file ( not compressed ) ?
I've tried cosOpenFiltered and cosOpenRaw and it doesn't work
char* ptr1 = new char[2800000];
ASFile asGLTFFile = NULL;
CosObj stm = PDAnnotGetCosObj(annot);
CosObj stm3d = CosDictGetKeyString(stm,"3DD");
ASStm streamopen = CosStreamOpenStm(stm3d,cosOpenUnfiltered);
ASTArraySize lenghth = CosStreamLength(stm3d);
ASTCount a = ASStmRead(ptr1,1,lenghth,streamopen);
#if WIN_PLATFORM
const char* GLTFStringName = "C:\\setDefaultCamera.gltf";
#else
const char* GLTFStringName = "/Users/Shared/file1.gltf";
#endif
BuildFile(GLTFStringName);
#ifdef WIN_PLATFORM
const char* strPathFlag = "Cstring";
#else
const char* strPathFlag = "POSIXPath";
#endif
ASPathName GLTFPathName = ASFileSysCreatePathName (ASGetDefaultFileSys(),
ASAtomFromString(strPathFlag), GLTFStringName, 0);
ASInt32 BRet = ASFileSysOpenFile(ASGetDefaultFileSys(), GLTFPathName, ASFILE_WRITE, &asGLTFFile);
ASFileSysReleasePath (ASGetDefaultFileSys(), GLTFPathName);
ASTArraySize Bret = ASFileWrite(asGLTFFile,ptr1,lenghth);
ASStmClose(streamopen);
ASFileClose(asGLTFFile);
