protected void doRun() throws IOException {
        GetObjectRequest getObjectRequest = new GetObjectRequest(bucketName, fileName);
        getObjectRequest.setRange(bytePosition, metadata.getContentLength());
        COSObject cosObject = cosClient.getObject(getObjectRequest);
        InputStream inputStream = cosObject.getObjectContent();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        int num;
        boolean overLen = false;
        while ((num = inputStream.read(bufferToReadFile)) != -1) {
            LOGGER.debug("read size {}", num);
            for (int i = 0; i < num; i++) {
                byte ch = bufferToReadFile[i];
                bytePosition++;
                switch (ch) {
                    case '\n':
                        linePosition++;
                        boolean suc = false;
                        while (isRunnable() && !suc) {
                            SourceData sourceData = new SourceData(baos.toByteArray(),
                                    getOffsetString(linePosition, bytePosition));
                            boolean suc4Queue = waitForPermit(AGENT_GLOBAL_COS_SOURCE_PERMIT,
                                    sourceData.getData().length);
                            if (!suc4Queue) {
                                break;
                            }
                            suc = queue.offer(sourceData);
                            if (!suc) {
                                MemoryManager.getInstance()
                                        .release(AGENT_GLOBAL_COS_SOURCE_PERMIT, sourceData.getData().length);
                                AgentUtils.silenceSleepInMs(WAIT_TIMEOUT_MS);
                            }
                        }
                        if (overLen) {
                            LOGGER.warn("readLines over len finally string len {}",
                                    new String(baos.toByteArray()).length());
                            long auditTime = 0;
                            auditTime = profile.getSinkDataTime();
                            AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_READ_FAILED, inlongGroupId, inlongStreamId,
                                    auditTime, 1, maxPackSize, auditVersion);
                            AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_READ_FAILED_REAL_TIME, inlongGroupId,
                                    inlongStreamId, AgentUtils.getCurrentTime(), 1, maxPackSize, auditVersion);
                        }
                        baos.reset();
                        overLen = false;
                        break;
                    case '\r':
                        break;
                    default:
                        if (baos.size() < maxPackSize) {
                            baos.write(ch);
                        } else {
                            overLen = true;
                        }
                }
            }
        }
        baos.close();
        inputStream.close();
        cosObject.close();
    }
Read new lines.

@return The new position after the lines have been read
@throws IOException if an I/O error occurs.
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/COSSource.java