Add auto-size read-bytes
This commit is contained in:
parent
e554dbb1c5
commit
57eae96c7b
1 changed files with 12 additions and 4 deletions
|
|
@ -1056,11 +1056,19 @@
|
||||||
|
|
||||||
;;;; Thawing
|
;;;; Thawing
|
||||||
|
|
||||||
(defn- read-bytes [^DataInput in len]
|
(defn- read-bytes
|
||||||
|
([^DataInput in len]
|
||||||
(let [ba (byte-array len)]
|
(let [ba (byte-array len)]
|
||||||
(.readFully in ba 0 len)
|
(.readFully in ba 0 len)
|
||||||
ba))
|
ba))
|
||||||
|
|
||||||
|
([^DataInput in]
|
||||||
|
(enc/case-eval (.readByte in)
|
||||||
|
id-bytes-0 (byte-array 0)
|
||||||
|
id-bytes-sm (read-bytes in (read-sm-count in))
|
||||||
|
id-bytes-md (read-bytes in (read-md-count in))
|
||||||
|
id-bytes-lg (read-bytes in (read-lg-count in)))))
|
||||||
|
|
||||||
(defn- read-bytes-sm [^DataInput in] (read-bytes in (read-sm-count in)))
|
(defn- read-bytes-sm [^DataInput in] (read-bytes in (read-sm-count in)))
|
||||||
(defn- read-bytes-md [^DataInput in] (read-bytes in (read-md-count in)))
|
(defn- read-bytes-md [^DataInput in] (read-bytes in (read-md-count in)))
|
||||||
(defn- read-bytes-lg [^DataInput in] (read-bytes in (read-lg-count in)))
|
(defn- read-bytes-lg [^DataInput in] (read-bytes in (read-lg-count in)))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue