diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/Utils.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/Utils.kt index dae79e6fc0..5e64de2c54 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/Utils.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/Utils.kt @@ -137,7 +137,7 @@ fun saveAnimImage(uri: URI, encrypted: Boolean): CryptoFile? { val destFileName = generateNewFileName("IMG", ext) val destFile = File(getAppFilePath(destFileName)) if (encrypted) { - val args = writeCryptoFile(destFile.absolutePath, uri.inputStream()?.readAllBytes() ?: return null) + val args = writeCryptoFile(destFile.absolutePath, uri.inputStream()?.readBytes() ?: return null) CryptoFile(destFileName, args) } else { Files.copy(uri.inputStream(), destFile.toPath()) diff --git a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/Images.desktop.kt b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/Images.desktop.kt index c04587656f..0df5ee8156 100644 --- a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/Images.desktop.kt +++ b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/Images.desktop.kt @@ -170,9 +170,8 @@ actual fun isAnimImage(uri: URI, drawable: Any?): Boolean { return path.endsWith(".gif") || path.endsWith(".webp") } -@Suppress("NewApi") actual fun loadImageBitmap(inputStream: InputStream): ImageBitmap = - Image.makeFromEncoded(inputStream.readAllBytes()).toComposeImageBitmap() + Image.makeFromEncoded(inputStream.readBytes()).toComposeImageBitmap() // https://stackoverflow.com/a/68926993 fun BufferedImage.rotate(angle: Double): BufferedImage { diff --git a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/views/call/CallView.desktop.kt b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/views/call/CallView.desktop.kt index 42def0c75f..cce8a3ce85 100644 --- a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/views/call/CallView.desktop.kt +++ b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/views/call/CallView.desktop.kt @@ -189,12 +189,11 @@ fun startServer(onResponse: (WVAPIMessage) -> Unit): NanoWSD { val server = object: NanoWSD(SERVER_HOST, SERVER_PORT) { override fun openWebSocket(session: IHTTPSession): WebSocket = MyWebSocket(onResponse, session) - @Suppress("NewApi") fun resourcesToResponse(path: String): Response { val uri = Class.forName("chat.simplex.common.AppKt").getResource("/assets/www$path") ?: return resourceNotFound val response = newFixedLengthResponse( Status.OK, getMimeTypeForFile(uri.file), - uri.openStream().readAllBytes() + uri.openStream().readBytes() ) response.setKeepAlive(true) response.setUseGzip(true)