ByteStreamPtr PacketBufferV::getNextByteStream(dword sizeB) { if(currentIndexBS >= size()) currentIndexBS = 0; return getByteStream(currentIndexBS++, sizeB); }
void NodeMemory_v1::findData(uint32 bytePosition, ByteStream** data, uint16& offset) { //check if we are trying to read outside the bounds of logged data if(bytePosition > m_totalBytes) { throw Error_NoData("There is no more data available to download from the Node."); } //find the page and offset from the byte position uint16 page = 0; findPageAndOffset(bytePosition, page, offset); //get the ByteStream data to read *data = getByteStream(page); }
// There is only object of class DjVuMessage in a program, and here it is: //DjVuMessage DjVuMsg; const DjVuMessageLite & DjVuMessageLite::create_lite(void) { GP<DjVuMessageLite> &static_message=getDjVuMessageLite(); if(!static_message) { static_message=new DjVuMessageLite; } DjVuMessageLite &m=*static_message; GPList<ByteStream> &bs = getByteStream(); for(GPosition pos;(pos=bs);bs.del(pos)) { m.AddByteStream(bs[pos]); } return m; }
void DjVuMessageLite::AddByteStreamLater(const GP<ByteStream> &bs) { getByteStream().append(bs); }