@Override
    public <T> int readFieldNumber(Schema<T> schema) throws IOException
    {
        if (offset + 2 > limit && !readable(2))
        {
            if (offset != limit)
                throw new ProtostuffException("Truncated message.");

            return 0;
        }

        final int size = buffer[offset++] | (buffer[offset++] << 8);

        if (offset + size > limit && !readable(size))
            throw new ProtostuffException("Truncated message.");

        final int number = numeric ? parseInt(buffer, offset, size, 10, true) :
                schema.getFieldNumber(STRING.deser(buffer, offset, size));

        offset += size;

        if (number == 0)
        {
            // skip unknown fields.
            handleUnknownField(number, schema);
            return readFieldNumber(schema);
        }

        return number;
    }
Returns true if there are {@code minimum} bytes available for reading.
<p>
The caller is responsible that the arg {@code minimum} is not larger than the buffer size.
protostuff-kvp/src/main/java/io/protostuff/KvpInput.java