MCPcopy Create free account
hub / github.com/cuberite/cuberite / ReadVarInt

Method ReadVarInt

src/ByteBuffer.cpp:429–445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

427
428
429bool cByteBuffer::ReadVarInt(UInt32 & a_Value)
430{
431 CHECK_THREAD;
432 CheckValid();
433 UInt32 Value = 0;
434 int Shift = 0;
435 unsigned char b = 0;
436 do
437 {
438 NEEDBYTES(1);
439 ReadBuf(&b, 1);
440 Value = Value | (((Int64)(b & 0x7f)) << Shift);
441 Shift += 7;
442 } while ((b & 0x80) != 0);
443 a_Value = Value;
444 return true;
445}
446
447
448

Callers 9

TestReadMethod · 0.45
TryRecognizeProtocolMethod · 0.45
AddReceivedDataMethod · 0.45
DecodeClientsPacketsMethod · 0.45
DecodeServersPacketsMethod · 0.45
ParseMetadataMethod · 0.45
LogMetadataMethod · 0.45

Calls

no outgoing calls

Tested by 1

TestReadMethod · 0.36