Skip to content

Instantly share code, notes, and snippets.

@amalloy
Created April 8, 2012 05:50
Show Gist options
  • Save amalloy/2335054 to your computer and use it in GitHub Desktop.
Save amalloy/2335054 to your computer and use it in GitHub Desktop.
user> (import '(java.io ByteArrayInputStream ByteArrayOutputStream ObjectInputStream ObjectOutputStream))
java.io.ObjectOutputStream
user> (false? (-> (ByteArrayOutputStream.)
(doto (-> (ObjectOutputStream.) (.writeObject false)))
(.toByteArray)
(ByteArrayInputStream.)
(ObjectInputStream.)
(.readObject)))
false
user> (def f (-> (ByteArrayOutputStream.)
(doto (-> (ObjectOutputStream.) (.writeObject false)))
(.toByteArray)
(ByteArrayInputStream.)
(ObjectInputStream.)
(.readObject)))
#'user/f
user> (false? f)
true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment