@Override
    protected void releaseSource() {
        if (randomAccessFile != null) {
            try {
                FileStatic data = new FileStatic();
                data.setTaskId(taskId);
                data.setRetry(String.valueOf(profile.isRetry()));
                data.setContentType(profile.get(FILE_CONTENT_STYLE));
                data.setGroupId(profile.getInlongGroupId());
                data.setStreamId(profile.getInlongStreamId());
                data.setDataTime(format.format(profile.getSinkDataTime()));
                data.setFileName(profile.getInstanceId());
                data.setFileLen(String.valueOf(randomAccessFile.length()));
                data.setReadBytes(String.valueOf(bytePosition));
                data.setReadLines(String.valueOf(linePosition));
                OffsetProfile offsetProfile = OffsetManager.getInstance().getOffset(taskId, instanceId);
                if (offsetProfile != null) {
                    data.setSendLines(offsetProfile.getOffset());
                }
                FileStaticManager.putStaticMsg(data);
                randomAccessFile.close();
            } catch (IOException e) {
                LOGGER.error("close randomAccessFile error", e);
            }
        }
    }
Read new lines.

@param reader The file to read
@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/LogFileSource.java