Example #1
0
			void flush()
			{
				if ( curcnt )
				{
					*(pc++) = ptype(cursym,curcnt);
					implicitFlush();
					curcnt = 0;
				}

				SGO.flush();

				uint64_t const indexpos = SGO.getWrittenBytes();
				writeIndex(indexpos);				
			}
Example #2
0
			void implicitFlush()
			{
				uint64_t const bs = pc-pa;
				
				if ( bs )
				{
					uint64_t acc = 0;
					uint64_t const pos = SGO.getWrittenBytes();

					GE.encode(bs);
					for ( uint64_t i = 0; i < bs; ++i )
					{
						acc += pa[i].second;
						GE.encodeWord(pa[i].first,albits);
						GE.encode(pa[i].second);
					}
					GE.flush();
					
					::libmaus::huffman::IndexEntry const entry(pos,bs,acc);
					index.push_back(entry);
					
					pc = pa;
				}
			}