Skip to content

Instantly share code, notes, and snippets.

@deltam
Created June 27, 2015 12:39
Show Gist options
  • Save deltam/4fece93a66504ab72b08 to your computer and use it in GitHub Desktop.
Save deltam/4fece93a66504ab72b08 to your computer and use it in GitHub Desktop.
バイナリファイルを読む
(defn read-as-byte-array [filename]
(with-open [fis (java.io.FileInputStream. filename)]
(let [channel (.getChannel fis)
byte-buf (java.nio.ByteBuffer/allocate 100000)]
(.read channel byte-buf)
byte-buf)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment