inputstream

'Inappropriate blocking method call' - How to handle this warning on Android Studio

我只是一个虾纸丫 提交于 2020-12-15 00:53:16
问题 I have written this code snippet to download image files from firebase storage to local storage. contentResolver.openOutputStream(uri)?.use { ops -> // * Firebase.storage.getReferenceFromUrl(model.mediaUrl).stream.await().stream.use { ips -> val buffer = ByteArray(1024) while (true) { val bytes = ips.read(buffer) // * if (bytes == -1) break ops.write(buffer, 0, bytes) // * } } } In the marked lines, android studio is giving me Inappropriate blocking method call warning, highlighting

'Inappropriate blocking method call' - How to handle this warning on Android Studio

て烟熏妆下的殇ゞ 提交于 2020-12-15 00:48:41
问题 I have written this code snippet to download image files from firebase storage to local storage. contentResolver.openOutputStream(uri)?.use { ops -> // * Firebase.storage.getReferenceFromUrl(model.mediaUrl).stream.await().stream.use { ips -> val buffer = ByteArray(1024) while (true) { val bytes = ips.read(buffer) // * if (bytes == -1) break ops.write(buffer, 0, bytes) // * } } } In the marked lines, android studio is giving me Inappropriate blocking method call warning, highlighting

'Inappropriate blocking method call' - How to handle this warning on Android Studio

谁都会走 提交于 2020-12-15 00:48:13
问题 I have written this code snippet to download image files from firebase storage to local storage. contentResolver.openOutputStream(uri)?.use { ops -> // * Firebase.storage.getReferenceFromUrl(model.mediaUrl).stream.await().stream.use { ips -> val buffer = ByteArray(1024) while (true) { val bytes = ips.read(buffer) // * if (bytes == -1) break ops.write(buffer, 0, bytes) // * } } } In the marked lines, android studio is giving me Inappropriate blocking method call warning, highlighting

How to set InputStream content Length

。_饼干妹妹 提交于 2020-08-01 09:24:11
问题 I am uploading files to Amazon S3 bucket. The files are being uploaded but i get the following Warning. WARNING: No content length specified for stream data. Stream contents will be buffered in memory and could result in out of memory errors. So I added the following line to my code metaData.setContentLength(IOUtils.toByteArray(input).length); but then i got the following message. I don't even know if it is a warning or what. Data read has a different length than the expected: dataLength=0;