    [stl-collector.model :as stl]
    [stl-collector.file :as stl-file]
    [clojure.java.io :as io]
-   [nio.core :as nio]
-   [clojure.pprint :as pp])
+   [nio.core :as nio])
   
   (:import (java.nio ByteOrder DirectByteBuffer)))
-
-(defn calculate-offset [offset n size]
-  (+ offset (* n size)))
 
 (defn pad [buffer offset num_bytes]
   (if (> num_bytes 0)

                                             offset
                                             length)
                               (.order ByteOrder/LITTLE_ENDIAN))
          post-header-offset (write-header buffer num_facets)
          process-facets     (fn [buffer offset facets]
                               (if (seq facets)
                                 (let [[f & fs] facets
                                       new-offset (write-facet buffer offset f)]
                                   (recur buffer new-offset fs))
                                 offset))]
      (process-facets buffer post-header-offset stl-seq))))



(defn write-header
  [buffer count]
  (pad buffer 0 stl-file/MESSAGE_LENGTH)
  (.putInt buffer stl-file/MESSAGE_LENGTH count)
  stl-file/HEADER_LENGTH)

(defn write-facet
