-
-
Save mrb/6dcba245ab08354a0a8d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(is-redis-dump-file "/Users/mrb/dump.rdb") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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