Clean up terminal configuration

This commit is contained in:
Mike Cifelli 2018-09-15 14:03:43 -04:00
parent e76aefa3d1
commit a20849a5b4
1 changed files with 6 additions and 10 deletions

View File

@ -9,15 +9,11 @@ import java.io.PipedOutputStream
class TerminalConfiguration { class TerminalConfiguration {
var inputWriter: PipedOutputStream? = null lateinit var inputWriter: PipedOutputStream
private set
lateinit var inputReader: PipedInputStream lateinit var inputReader: PipedInputStream
private set lateinit var outputWriter: PipedOutputStream
var outputWriter: PipedOutputStream? = null lateinit var outputReader: PipedInputStream
private set lateinit var terminal: IOSafeTerminal
var outputReader: PipedInputStream? = null
private set
var terminal: IOSafeTerminal? = null
fun setInputPair(inputWriter: PipedOutputStream, inputReader: PipedInputStream) { fun setInputPair(inputWriter: PipedOutputStream, inputReader: PipedInputStream) {
this.inputWriter = inputWriter this.inputWriter = inputWriter
@ -27,7 +23,7 @@ class TerminalConfiguration {
private fun connectInputPair() { private fun connectInputPair() {
try { try {
inputWriter!!.connect(inputReader!!) inputWriter.connect(inputReader)
} catch (e: IOException) { } catch (e: IOException) {
throw LispIOException(e) throw LispIOException(e)
} }
@ -41,7 +37,7 @@ class TerminalConfiguration {
private fun connectOutputPair() { private fun connectOutputPair() {
try { try {
outputWriter!!.connect(outputReader!!) outputWriter.connect(outputReader)
} catch (e: IOException) { } catch (e: IOException) {
throw LispIOException(e) throw LispIOException(e)
} }