Created
October 27, 2016 21:37
-
-
Save noisesmith/d6f8ed1a75c0b57873f100390f0bec54 to your computer and use it in GitHub Desktop.
get a file over http, at an arbitrary offset, without downloading everything
This file contains hidden or 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
(import (java.net URL)) | |
(defn skipped-url | |
[url byte-skip byte-end] | |
(let [http-connection (.openConnection url)] | |
(.setRequestProperty http-connection | |
"Range" (str "bytes=" byte-skip "-" byte-end)) | |
(.getInputStream http-connection))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment