Skip to content

Commit

Permalink
fix(Resources): Use readNBytes() to read a chunk of resources JetBrai…
Browse files Browse the repository at this point in the history
  • Loading branch information
AChep committed Jun 7, 2024
1 parent fc90219 commit ea22539
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ internal actual fun getPlatformResourceReader(): ResourceReader = object : Resou

override suspend fun readPart(path: String, offset: Long, size: Long): ByteArray {
val resource = getResourceAsStream(path)
val result = ByteArray(size.toInt())
resource.use { input ->
return resource.use { input ->
input.skip(offset)
input.read(result, 0, size.toInt())
input.readNBytes(size.toInt())
}
return result
}

override fun getUri(path: String): String {
Expand Down

0 comments on commit ea22539

Please sign in to comment.