From 238dc19e69191e1fc16c91aa56073fd278de73e4 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 26 Mar 2020 22:21:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/model/localBook/AnalyzeTxtFile.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/model/localBook/AnalyzeTxtFile.kt b/app/src/main/java/io/legado/app/model/localBook/AnalyzeTxtFile.kt index baecb9a57..a77bdc0b6 100644 --- a/app/src/main/java/io/legado/app/model/localBook/AnalyzeTxtFile.kt +++ b/app/src/main/java/io/legado/app/model/localBook/AnalyzeTxtFile.kt @@ -63,7 +63,8 @@ class AnalyzeTxtFile { while (bookStream.read(buffer).also { length = it } > 0) { blockPos++ //如果存在Chapter - if (rulePattern != null) { //将数据转换成String + if (rulePattern != null) { + //将数据转换成String, 不能超过length var blockContent = String(buffer, 0, length, charset) val lastN = blockContent.lastIndexOf("\n") if (lastN > 0) {