MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / start

Method start

src/main/java/trace/video/SimpleHead.kt:69–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67
68 var started: Boolean = false
69
70 @JvmStatic
71 fun start(path: String) {
72 if (started) return
73
74 if (!File(path).exists()) throw IllegalArgumentException(" can't find the path '${path}', typo?")
75 if (!File(path + "/simpleHead").exists()) throw IllegalArgumentException(" can't find the binary inside'${path}', is this the correct directory?")
76
77 val b = ProcessBuilder()
78 b.command(path + "/simpleHead").redirectErrorStream(true)
79 val p = b.start()
80 val reader = p.inputStream.bufferedReader()
81
82 head = SimpleHead()
83
84 Thread {
85 started = true
86
87 while (true) {
88 try {
89 val rr = reader.readLine()
90 print("r " + rr)
91 if (rr != null)
92 now = head!!.readLine(rr)
93 } catch (e: Exception) {
94 e.printStackTrace()
95 Thread.sleep(5)
96 }
97 }
98 }.start()
99
100 }
101
102 @JvmStatic

Callers

nothing calls this directly

Calls 4

FileFunction · 0.85
SimpleHeadClass · 0.85
existsMethod · 0.80
readLineMethod · 0.45

Tested by

no test coverage detected