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

com.thejholmes.russound.serial.SerialCommandSender.kt Maven / Gradle / Ivy

package com.thejholmes.russound.serial

import com.thejholmes.russound.RussoundCommandSender
import java.io.File
import java.io.OutputStream

class SerialCommandSender(val outputStream: OutputStream) : RussoundCommandSender {
  override fun send(byteArray: ByteArray) {
    outputStream.write(byteArray)
    outputStream.flush()
  }

  companion object Factory {
    fun fromFile(file: File): RussoundCommandSender {
      return SerialCommandSender(file.outputStream())
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy