Более большой буфер чтения индексов pak файлов

This commit is contained in:
DBotThePony 2023-02-05 11:08:03 +07:00
parent 8042cd0a22
commit af7ff24320
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 3 additions and 3 deletions

View File

@ -358,10 +358,10 @@ object Starbound {
var time = System.currentTimeMillis()
if (archivePaths.isNotEmpty()) {
callback(false, false, "Reading pak archives...".also(LOGGER::info))
callback(false, false, "Searching for pak archives...".also(LOGGER::info))
for (path in archivePaths) {
callback(false, false, "Reading ${path.name}...".also(LOGGER::info))
callback(false, false, "Reading index of ${path.name}...".also(LOGGER::info))
addPak(StarboundPak(path) { _, status ->
callback(false, true, "${path.name}: $status")

View File

@ -193,7 +193,7 @@ class StarboundPak(val path: File, callback: (finished: Boolean, status: String)
// byte[] (utf-8 имя файла)
// long (offset от начала файла)
// long (длина файла)
val stream = DataInputStream(BufferedInputStream(Channels.newInputStream(reader.channel)))
val stream = DataInputStream(BufferedInputStream(Channels.newInputStream(reader.channel), 2 shl 22))
for (i in 0 until indexNodeCount) {
var name: String? = null