Skip to content

Instantly share code, notes, and snippets.

@noisesmith
Created May 1, 2016 18:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noisesmith/f2ca73a0a6b0e5d686487c6084196a97 to your computer and use it in GitHub Desktop.
Save noisesmith/f2ca73a0a6b0e5d686487c6084196a97 to your computer and use it in GitHub Desktop.
+user=> (def c (ProcessBuilder. (into-array ["cat"])))
#'user/c
+user=> (def p (.start c))
#'user/p
+user=> (def o (.getOutputStream p))
#'user/o
+user=> (.write o (.getBytes "hello\n\n"))
nil
+user=> (.flush o)
nil
+user=> (def i (.getInputStream p))
#'user/i
+user=> (.read i)
104
+user=> (.read i)
101
+user=> (.read i)
108
+user=> (.read i)
108
+user=> (.read i)
111
+user=> (.read i)
10
+user=> (.read i)
10
+user=> (.read i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment