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