Read a raw Varint from the stream.
165110
public long readRawVarint64() throws IOException
    {
        int shift = 0;
        long result = 0;
        while (shift < 64)
        {
            final byte b = readRawByte();
            result |= (long) (b & 0x7F) << shift;
            if ((b & 0x80) == 0)
            {
                return result;
            }
            shift += 7;
        }
        throw ProtobufException.malformedVarint();
    }
461469
private int readRawVarint32(ByteBuffer bytes) {
    byte tmp = bytes.get();
    if (tmp >= 0) {
      return tmp;
    }
    int result = tmp & 0x7f;
    if ((tmp = bytes.get()) >= 0) {
      result |= tmp << 7;
    } else {
      result |= (tmp & 0x7f) << 7;
      if ((tmp = bytes.get()) >= 0) {
        result |= tmp << 14;
      } else {
        result |= (tmp & 0x7f) << 14;
        if ((tmp = bytes.get()) >= 0) {
          result |= tmp << 21;
        } else {
          result |= (tmp & 0x7f) << 21;
          result |= (tmp = bytes.get()) << 28;
          if (tmp < 0) {
            // Discard upper 32 bits.
            for (int i = 0; i < 5; i++) {
              if (bytes.get() >= 0) {
                return result;
              }
            }
            connectionHandler.onException(new ScopeException("Error while reading raw int"));
          }
        }
      }
    }
    return result;
  }
1106219
def read_varint64(self):
        
        i = self.read_var_uint64()
        if i > wire_format.INT64_MAX:
            i -= (1 << 64)
        return i
1055169
def read (self, stream):
        """"""
        self._data = stream.read(self._size)

        if len(self._data) >= self._size:
            values = struct.unpack(self._format, self._data)
        else:
            values = None, None, None, None, None, None, None

        if   values[0] == 0xA1B2C3D4 or values[0] == 0xA1B23C4D:
            self._swap = '@'
        elif values[0] == 0xD4C3B2A1 or values[0] == 0x4D3CB2A1:
            self._swap = EndianSwap

        if values[0] is not None:
            values = struct.unpack(self._swap + self._format, self._data)

        self.magic_number  = values[0]
        self.version_major = values[1]
        self.version_minor = values[2]
        self.thiszone      = values[3]
        self.sigfigs       = values[4]
        self.snaplen       = values[5]
        self.network       = values[6]
1254869
protected int readInt(InputStream is) throws IOException
   {
      byte[] data = new byte[4];
      if (is.read(data) != data.length)
      {
         throw new EOFException();
      }

      return (MPPUtility.getInt(data, 0));
   }
1161726
def read(self):
        # type: () -> str
        """"""
        s = self._buf + self._raw.read()
        self._buf = ''
        return s
1068621
def _parse_value(cls, stream_rdr, offset, value_count, value_offset):
        
        if value_count == 1:
            return stream_rdr.read_short(offset, 8)
        else:  # pragma: no cover
            return 'Multi-value short integer NOT IMPLEMENTED'
328511
private static int readRawVarint32(ByteBuf buffer) {
        if (!buffer.isReadable()) {
            return 0;
        }
        buffer.markReaderIndex();
        byte tmp = buffer.readByte();
        if (tmp >= 0) {
            return tmp;
        } else {
            int result = tmp & 127;
            if (!buffer.isReadable()) {
                buffer.resetReaderIndex();
                return 0;
            }
            if ((tmp = buffer.readByte()) >= 0) {
                result |= tmp << 7;
            } else {
                result |= (tmp & 127) << 7;
                if (!buffer.isReadable()) {
                    buffer.resetReaderIndex();
                    return 0;
                }
                if ((tmp = buffer.readByte()) >= 0) {
                    result |= tmp << 14;
                } else {
                    result |= (tmp & 127) << 14;
                    if (!buffer.isReadable()) {
                        buffer.resetReaderIndex();
                        return 0;
                    }
                    if ((tmp = buffer.readByte()) >= 0) {
                        result |= tmp << 21;
                    } else {
                        result |= (tmp & 127) << 21;
                        if (!buffer.isReadable()) {
                            buffer.resetReaderIndex();
                            return 0;
                        }
                        result |= (tmp = buffer.readByte()) << 28;
                        if (tmp < 0) {
                            throw new CorruptedFrameException("malformed varint.");
                        }
                    }
                }
            }
            return result;
        }
    }
939507
def _VarintBytes(value):
  """"""

  pieces = []
  _EncodeVarint(pieces.append, value)
  return b"".join(pieces)
885648
function parseVarInt(cursor) {
    var result = 0, byte;

    do {
        byte = cursor.readUInt8();

        result <<= 7;
        result |= byte & 0x7F;
    } while (byte & 0x80);

    return result;
}
1259048
async def dump_varint(writer, val):
    
    if val <= 63:
        return await dump_varint_t(writer, PortableRawSizeMark.BYTE, val)
    elif val <= 16383:
        return await dump_varint_t(writer, PortableRawSizeMark.WORD, val)
    elif val <= 1073741823:
        return await dump_varint_t(writer, PortableRawSizeMark.DWORD, val)
    else:
        if val > 4611686018427387903:
            raise ValueError('Int too big')
        return await dump_varint_t(writer, PortableRawSizeMark.INT64, val)
354910
public int readRawVarint32() throws IOException {
    byte tmp = readRawByte();
    if (tmp >= 0) {
      return tmp;
    }
    int result = tmp & 0x7f;
    if ((tmp = readRawByte()) >= 0) {
      result |= tmp << 7;
    } else {
      result |= (tmp & 0x7f) << 7;
      if ((tmp = readRawByte()) >= 0) {
        result |= tmp << 14;
      } else {
        result |= (tmp & 0x7f) << 14;
        if ((tmp = readRawByte()) >= 0) {
          result |= tmp << 21;
        } else {
          result |= (tmp & 0x7f) << 21;
          result |= (tmp = readRawByte()) << 28;
          if (tmp < 0) {
            // Discard upper 32 bits.
            for (int i = 0; i < 5; i++) {
              if (readRawByte() >= 0) {
                return result;
              }
            }
            throw InvalidProtocolBufferException.malformedVarint();
          }
        }
      }
    }
    return result;
  }
448250
public static void read() throws IOException, InterruptedException {
        for(short channel = 0; channel < ADC_CHANNEL_COUNT; channel++){
            int conversion_value = getConversionValue(channel);
            console.print(String.format(" | %04d", conversion_value)); // print 4 digits with leading zeros
        }
        console.print(" |\r");
        Thread.sleep(250);
    }
102925
def read(self, size=-1):
        """"""
        if size == 0:
            return b''
        elif size < 0:
            from_buf = self._read_from_buffer()
            self._current_pos = self._content_length
            return from_buf + self._raw_reader.read()

        #
        # Return unused data first
        #
        if len(self._buffer) >= size:
            return self._read_from_buffer(size)

        #
        # If the stream is finished, return what we have.
        #
        if self._eof:
            return self._read_from_buffer()

        #
        # Fill our buffer to the required size.
        #
        # logger.debug('filling %r byte-long buffer up to %r bytes', len(self._buffer), size)
        self._fill_buffer(size)
        return self._read_from_buffer(size)
820809
async def dump_varint_t(writer, type_or, pv):
    
    width = int_mark_to_size(type_or)
    n = (pv << 2) | type_or

    buffer = _UINT_BUFFER
    for _ in range(width):
        buffer[0] = n & 0xff
        await writer.awrite(buffer)
        n >>= 8

    return width
819916
public long readRawVarint64() throws IOException
    {
        // final byte[] buffer = this.buffer;
        // int offset = this.offset;

        int shift = 0;
        long result = 0;
        while (shift < 64)
        {
            final byte b = buffer.get();
            result |= (long) (b & 0x7F) << shift;
            if ((b & 0x80) == 0)
            {
                // this.offset = offset;
                return result;
            }
            shift += 7;
        }
        throw ProtobufException.malformedVarint();
    }
1044280
def read_var_uint32(self):
        
        i = self.read_var_uint64()
        if i > wire_format.UINT32_MAX:
            raise errors.DecodeError('Value out of range for uint32: %d' % i)
        return i