@Override
    public long read(ByteBuffer[] dsts, int offset, int length) throws IOException {
        if ((offset < 0) || (length < 0) || (offset > dsts.length - length))
            throw new IndexOutOfBoundsException();

        int totalRead = 0;
        int i = offset;
        while (i < offset + length) {
            if (dsts[i].hasRemaining()) {
                int read = read(dsts[i]);
                if (read > 0)
                    totalRead += read;
                else
                    break;
            }
            if (!dsts[i].hasRemaining()) {
                i++;
            }
        }
        return totalRead;
    }
Reads a sequence of bytes from this channel into a subsequence of the given buffers.
@param dsts - The buffers into which bytes are to be transferred
@param offset - The offset within the buffer array of the first buffer into which bytes are to be transferred; must be non-negative and no larger than dsts.length.
@param length - The maximum number of buffers to be accessed; must be non-negative and no larger than dsts.length - offset
@return The number of bytes read, possibly zero, or -1 if the channel has reached end-of-stream.
@throws IOException if some other I/O error occurs
clients/src/main/java/org/apache/kafka/common/network/SslTransportLayer.java