static int readRawVarint32(final InputStream input) throws IOException
    {
        final int firstByte = input.read();
        if (firstByte == -1)
        {
            throw ProtobufException.truncatedMessage();
        }

        if ((firstByte & 0x80) == 0)
        {
            return firstByte;
        }
        return readRawVarint32(input, firstByte);
    }
Reads a varint from the input one byte at a time, so that it does not read any bytes after the end of the varint.
If you simply wrapped the stream in a CodedInput and used {@link #readRawVarint32(InputStream)} then you would
probably end up reading past the end of the varint since CodedInput buffers its input.
protostuff-core/src/main/java/io/protostuff/CodedInput.java