mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-28 12:07:03 +02:00
Use copyTo to copy streams
This commit is contained in:
@@ -49,12 +49,7 @@ object MediaCompressorFileUtils {
|
||||
input: InputStream,
|
||||
output: OutputStream,
|
||||
) {
|
||||
val buffer = ByteArray(1024 * 50)
|
||||
var read = input.read(buffer)
|
||||
while (read != -1) {
|
||||
output.write(buffer, 0, read)
|
||||
read = input.read(buffer)
|
||||
}
|
||||
input.copyTo(output, bufferSize = 1024 * 50)
|
||||
}
|
||||
|
||||
private fun splitFileName(fileName: String): Pair<String, String> {
|
||||
|
Reference in New Issue
Block a user