   (unsafe [_] unsafe)
   (address [_] address)
 
+  Serializable
+  (serialize [this output-stream]
+    (serialize-bytes output-stream unsafe address (* num-records object-size)))
+
   Disposable
-
   (dispose [_] (.freeMemory unsafe address)))
 
 (defn make-record-collection [loaded-records]


(defn stoptime ^DateTime [loaded-record]
  (:stoptime loaded-record))

(defprotocol Disposable (dispose [this]))


             @ret
             (recur (inc i) (+ offset object-size) ret)))))))

(defn serialize-bytes [^OutputStream ostream ^Unsafe unsafe address num-bytes]
  (let [ostream (DataOutputStream. ostream)]
    (.writeLong ostream num-bytes)
    (dotimes [i num-bytes]
      (.write ostream (.getByte unsafe (+ address i))))))


;; deftype - implement Indexed,Counted,
(deftype RecordCollection [^Unsafe unsafe address num-records]

