MCPcopy Create free account
hub / github.com/PDAL/PDAL / inBufferShiftDown

Method inBufferShiftDown

plugins/e57/libE57Format/src/Decoder.cpp:311–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309}
310
311void BitpackDecoder::inBufferShiftDown()
312{
313 // Move uneaten data down to beginning of inBuffer_.
314 // Keep on natural boundaries.
315 // Moves all of word that contains inBufferFirstBit.
316 size_t firstWord = inBufferFirstBit_ / bitsPerWord_;
317 size_t firstNaturalByte = firstWord * bytesPerWord_;
318
319#if VALIDATE_BASIC
320 if ( firstNaturalByte > inBufferEndByte_ )
321 {
322 throw E57_EXCEPTION2( ErrorInternal, "firstNaturalByte=" + toString( firstNaturalByte ) +
323 " inBufferEndByte=" + toString( inBufferEndByte_ ) );
324 }
325#endif
326 size_t byteCount = inBufferEndByte_ - firstNaturalByte;
327 if ( byteCount > 0 )
328 {
329 memmove( inBuffer_.data(), &inBuffer_[firstNaturalByte],
330 byteCount ); // Overlapping regions ok with memmove().
331 }
332
333 // Update indexes
334 inBufferEndByte_ = byteCount;
335 inBufferFirstBit_ = inBufferFirstBit_ % bitsPerWord_;
336}
337
338#ifdef E57_ENABLE_DIAGNOSTIC_OUTPUT
339void BitpackDecoder::dump( int indent, std::ostream &os )

Callers

nothing calls this directly

Calls 2

toStringFunction · 0.70
dataMethod · 0.45

Tested by

no test coverage detected