Skip to content

Instantly share code, notes, and snippets.

@mrb
Created December 12, 2011 03:15
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 mrb/6dcba245ab08354a0a8d to your computer and use it in GitHub Desktop.
Save mrb/6dcba245ab08354a0a8d to your computer and use it in GitHub Desktop.
(is-redis-dump-file "/Users/mrb/dump.rdb")
(ns pianist.core
(:import (java.io FileOutputStream FileInputStream FileReader File)
(java.nio Buffer ByteBuffer CharBuffer)))
(defn file-to-bytes [path bytes]
(with-open [#^FileInputStream stream (FileInputStream. path)]
(let [ary (byte-array bytes)]
(.read stream ary)
(seq ary))))
(defn is-redis-dump-file [path]
(= '(82 69 68 73 83)
(file-to-bytes path 5)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment