Skip to content

Commit

Permalink
Fix JDK 9+ compile stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
jkelly467 committed Dec 11, 2019
1 parent 33a93e0 commit f7d671e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ plugins {

/* PUBLISHING */
group = 'ee.lib.kotlin'
version = "0.1.2"
version = "0.1.3"

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/kossh/impl/SSHCoExec.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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())
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/kossh/impl/SSHExec.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit f7d671e

Please sign in to comment.