|
|
@ -114,12 +114,14 @@ class TextFile(private val book: Book) { |
|
|
|
).also { length = it } > 0 |
|
|
|
).also { length = it } > 0 |
|
|
|
) { |
|
|
|
) { |
|
|
|
var end = bufferStart + length |
|
|
|
var end = bufferStart + length |
|
|
|
|
|
|
|
if (end == bufferSize) { |
|
|
|
for (i in bufferStart + length - 1 downTo 0) { |
|
|
|
for (i in bufferStart + length - 1 downTo 0) { |
|
|
|
if (buffer[i] == blank) { |
|
|
|
if (buffer[i] == blank) { |
|
|
|
end = i |
|
|
|
end = i |
|
|
|
break |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//将数据转换成String, 不能超过length |
|
|
|
//将数据转换成String, 不能超过length |
|
|
|
blockContent = String(buffer, 0, end, charset) |
|
|
|
blockContent = String(buffer, 0, end, charset) |
|
|
|
buffer.copyInto(buffer, 0, end, bufferStart + length) |
|
|
|
buffer.copyInto(buffer, 0, end, bufferStart + length) |
|
|
|