I would like to use scala.sys.process
to send a DOT description of a graph to dot
and retrieve the conversion to a binary image.
val process = "dot -T" + format
val inputStream = new ByteArrayInputStream(dot.getBytes("UTF-8"))
process #< inputStream !!
This would work fine but !!
returns a String
, not a Array[Byte]
. How can I get the response in bytes instead of a string? I don't think I can use the string as an intermediate representation because the binary data will not describe a valid string.