diff --git a/build.gradle b/build.gradle index 0296364..ca4b400 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,7 @@ plugins { /* PUBLISHING */ group = 'ee.lib.kotlin' -version = "0.1.2" +version = "0.1.3" sourceCompatibility = 1.8 targetCompatibility = 1.8 diff --git a/src/main/kotlin/kossh/impl/SSHCoExec.kt b/src/main/kotlin/kossh/impl/SSHCoExec.kt index 028f481..5911ba2 100644 --- a/src/main/kotlin/kossh/impl/SSHCoExec.kt +++ b/src/main/kotlin/kossh/impl/SSHCoExec.kt @@ -9,6 +9,7 @@ import java.nio.charset.Charset import kossh.util.* import kotlinx.coroutines.* import java.io.Closeable +import java.nio.Buffer class SSHCoExec(cmd: String, out: suspend ExecResult.()->Unit, @@ -81,7 +82,7 @@ class SSHCoExec(cmd: String, if (howmany == -1) eofreached = true if (howmany > 0) { buffer.put(bytes, 0, howmany) - buffer.flip() + (buffer as Buffer).flip() val cbOut = charset.decode(buffer) buffer.compact() appender.append(cbOut.toString()) diff --git a/src/main/kotlin/kossh/impl/SSHExec.kt b/src/main/kotlin/kossh/impl/SSHExec.kt index 6a64aa9..833c1f2 100644 --- a/src/main/kotlin/kossh/impl/SSHExec.kt +++ b/src/main/kotlin/kossh/impl/SSHExec.kt @@ -8,6 +8,7 @@ import java.nio.ByteBuffer import java.nio.charset.Charset import kossh.util.* import java.io.Closeable +import java.nio.Buffer class SSHExec(cmd: String, out: ExecResult.()->Unit, err: ExecResult.()->Unit, val ssh: SSH): Closeable { private val channel: ChannelExec = ssh.jschsession().openChannel("exec") as ChannelExec @@ -109,7 +110,7 @@ private class InputStreamThread(val channel: ChannelExec, val input: InputStream if (howmany == -1) eofreached = true if (howmany > 0) { buffer.put(bytes, 0, howmany) - buffer.flip() + (buffer as Buffer).flip() val cbOut = charset.decode(buffer) buffer.compact() appender.append(cbOut.toString())