static ByteBuffer getBufferLargerThan(ByteBuffer[] buffers, int minSize) {
        int length = buffers.length;
        for (int i = 0; i < length; i++) {
            ByteBuffer buffer = buffers[i];
            int remaining = buffer.remaining();
            if (remaining > 0) {
                if (remaining >= minSize) {
                    return buffer;
                }
                for (int j = i + 1; j < length; j++) {
                    if (buffers[j].remaining() > 0) {
                        return null;
                    }
                }
                return buffer;
            }
        }
        return null;
    }
Looks for a buffer in the buffer array which EITHER is larger than {@code minSize} AND
has no preceding non-empty buffers OR is the only non-empty buffer in the array.
common/src/main/java/org/conscrypt/BufferUtils.java