@Override
    public byte[] readByteArray() throws IOException
    {
        if (offset + 2 > limit && !readable(2))
            throw new ProtostuffException("Truncated message.");

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

        if (size == 0)
            return ByteString.EMPTY_BYTE_ARRAY;

        if (size > MAX_VALUE_SIZE)
            throw new ProtostuffException("Exceeded kvp max value size.");

        if (offset + size > limit)
            return fill(new byte[size], 0, size);

        final byte[] data = new byte[size];
        System.arraycopy(buffer, offset, data, 0, size);
        offset += size;
        return data;
    }
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