From 6f881dad5cfaefa76b2ebac63b96ddcb653d855a Mon Sep 17 00:00:00 2001 From: otto <731554297@qq.com> Date: Thu, 28 May 2026 09:06:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(AI=E8=B5=84=E6=BA=90=E5=B9=BF=E5=9C=BA):?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E8=A7=A3=E6=9E=90SKILL.md=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E6=97=B6=EF=BC=8C=E9=83=A8=E5=88=86=E6=83=85=E5=86=B5?= =?UTF-8?q?=E4=B8=8B=E4=BC=9A=E5=87=BA=E7=8E=B0=E4=B9=B1=E7=A0=81=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AiResourceParseServiceImpl.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/resource/service/impl/AiResourceParseServiceImpl.java b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/resource/service/impl/AiResourceParseServiceImpl.java index 42f099778..1c25ab913 100644 --- a/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/resource/service/impl/AiResourceParseServiceImpl.java +++ b/microservices-modules/microservices-modules-zone/src/main/java/com/microservices/zone/resource/service/impl/AiResourceParseServiceImpl.java @@ -22,6 +22,7 @@ import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream; import org.apache.commons.compress.archivers.zip.ZipFile; +import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -162,13 +163,13 @@ public class AiResourceParseServiceImpl implements IAiResourceParseService { } private String readEntryContent(ZipArchiveInputStream zais) throws IOException { - StringBuilder sb = new StringBuilder(); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buffer = new byte[4096]; int len; while ((len = zais.read(buffer)) > 0) { - sb.append(new String(buffer, 0, len, StandardCharsets.UTF_8)); + baos.write(buffer, 0, len); } - return sb.toString(); + return new String(baos.toByteArray(), StandardCharsets.UTF_8); } @Override @@ -285,13 +286,13 @@ public class AiResourceParseServiceImpl implements IAiResourceParseService { private String readZipEntryContent(ZipFile zf, ZipArchiveEntry entry) throws IOException { try (InputStream is = zf.getInputStream(entry)) { - StringBuilder sb = new StringBuilder(); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buffer = new byte[4096]; int len; while ((len = is.read(buffer)) > 0) { - sb.append(new String(buffer, 0, len, StandardCharsets.UTF_8)); + baos.write(buffer, 0, len); } - return sb.toString(); + return new String(baos.toByteArray(), StandardCharsets.UTF_8); } }