MCPcopy Create free account
hub / github.com/IENT/YUView / peekBytes

Method peekBytes

YUViewLib/src/parser/common/SubByteReader.cpp:361–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359}
360
361ByteVector SubByteReader::peekBytes(unsigned nrBytes) const
362{
363 if (this->posInBufferBits != 0 && this->posInBufferBits != 8)
364 throw std::logic_error("When peeking bytes from the bitstream, it must be byte aligned.");
365
366 auto pos = this->posInBufferBytes;
367 if (this->posInBufferBits == 8)
368 pos++;
369
370 if (pos + nrBytes > this->byteVector.size())
371 throw std::logic_error("Not enough data in the input to peek that far");
372
373 return ByteVector(this->byteVector.begin() + pos, this->byteVector.begin() + pos + nrBytes);
374}
375
376bool SubByteReader::gotoNextByte()
377{

Callers 2

parseMethod · 0.80
parseMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected