All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.avito.utils.CLIOutputReaderTask.kt Maven / Gradle / Ivy

Go to download

Collection of infrastructure libraries and gradle plugins of Avito Android project

There is a newer version: 2023.22
Show newest version
package com.avito.utils

import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.concurrent.Callable

internal class CLIOutputReaderTask(
    private val stdout: InputStream
) : Callable {

    override fun call(): String {
        val result = StringBuilder()
        val stdoutBuffer = BufferedReader(InputStreamReader(stdout))
        while (true) {
            val line = stdoutBuffer.readLine()
            if (line != null) {
                result.appendLine(line)
            } else {
                break
            }
        }
        return result.toString().trim()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy