         packets
         (let [header-boundary   (first header-boundaries)
               payload-boundary  (first payload-boundaries)
-              timestamp         (deserialize-timestamp buffer
-                                                       header-boundary)
+              timestamp         (if header-boundary
+                                  (deserialize-timestamp buffer header-boundary))
               payload           (deserialize-payload buffer
                                                      payload-boundary
                                                      entries)

             1 (.get buffer)
             2 (.getShort buffer)
             4 (.getInt buffer)
             8 (.getLong buffer)))
    (catch Exception e
      (println "deserialize-value: " (.getMessage e)))))

(defn- deserialize-payload [buffer boundary entries]
  "Deserializes a packet payload according to given boundary and form entries."
  (let [buffer (bounded-buffer buffer boundary)]
    (loop [entries entries
           payload {}]


(defn deserialize [raw-packet entries]
  "Deserializes one or more packets from a RawPacket according
  to given entries. Returns a list of destructured packets on success."
  (let [buffer (-> (.data raw-packet)
                   (ByteBuffer/wrap)
                   .asReadOnlyBuffer)]
