void APETAG::Iterator::getString(String8 *id) const { ///LOGE("getString() %x, %x, %x, flag %x", mFrameData, mFrameSize, getHeaderLength(), *(int32_t *)(mFrameData+4)); id->setTo(""); if (mFrameData == NULL) { return; } size_t n = mFrameSize - getHeaderLength(); char *temp = (char *) mFrameData + getHeaderLength(); for (int i = 0; i < n ; i++) { LOGV("getString() rawdata %x!!!!!", *(temp + i)); } if (((*(int32_t *)(mFrameData + 4)) & 0xe) == 0x00) // UTF-8 { id->setTo((const char *)(mFrameData + getHeaderLength()), n); } else // ISO 8859-1 { LOGE("getString() parse error %x!!!!!", *(int32_t *)(mFrameData + 4)); ///convertISO8859ToString8(mFrameData + getHeaderLength(), n, id); } }
ServerPktHeader(uint32 size, uint32 cmd, AuthCrypt* _authCrypt) : size(size) { if (_authCrypt->IsInitialized()) { uint32 data = (size << 13) | cmd & MAX_OPCODE; memcpy(&header[0], &data, 4); _authCrypt->EncryptSend((uint8*)&header[0], getHeaderLength()); } else { // Dynamic header size is not needed anymore, we are using not encrypted part for only the first few packets memcpy(&header[0], &size, 2); memcpy(&header[2], &cmd, 2); } }
data_chunk HttpResponse::doSerialize() const { // Reevaluate content length const_cast<http::Header&>(getHeaderLength()).setHeadValue(to_string(getContent().length())); DBG << "About to start serializing" << std::endl; data_chunk ret(itsResponse.Serialize()); DBG << "Serialized itsResponse" << std::endl; data_chunk tmph(itsHeaders.Serialize()); ret.insert(ret.end(), tmph.begin(), tmph.end()); DBG << "Serialized itsHeaders" << std::endl; data_chunk tmpc(itsContent.Serialize()); ret.insert(ret.end(), tmpc.begin(), tmpc.end()); DBG << "Serialized itsContent" << std::endl; return ret; }
AREXPORT void ArRobotPacket::finalizePacket(void) { int len = myLength; int chkSum; myLength = 0; uByteToBuf(mySync1); uByteToBuf(mySync2); uByteToBuf(len - getHeaderLength() + 3); myLength = len; chkSum = calcCheckSum(); byteToBuf((chkSum >> 8) & 0xff ); byteToBuf(chkSum & 0xff ); /* Put this in if you want to see the packets being outputted printf("Output(%3d) ", getID()); printHex(); */ // or put this in if you just want to see the type //printf("Output %d\n", getID()); }
ossim_uint64 ossimNitfImageInfoRecordV2_1::getTotalLength()const { return (getHeaderLength() + getImageLength()); }
ossim_int32 ossimNitfDataExtSegInfoRecordV2_0::getTotalLength()const { return (getHeaderLength() + getImageLength()); }