1193dce21ecd

Moar.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 21 Jun 2011 21:19:50 -0400
parents ff65b7a331b2
children b2c99ffc67de
branches/tags (none)
files src/clojurecraft/core.clj

Changes

--- a/src/clojurecraft/core.clj	Tue Jun 21 21:18:32 2011 -0400
+++ b/src/clojurecraft/core.clj	Tue Jun 21 21:19:50 2011 -0400
@@ -62,6 +62,11 @@
       (doto (:out @conn)
          (.writeDouble (int i))))
 
+(defn -write-float [conn i]
+      (println (str "-> FLOAT: " i))
+      (doto (:out @conn)
+         (.writeFloat (int i))))
+
 (defn -write-string16 [conn s]
       (-write-short conn (count s))
       (println (str "-> STRING: " s))
@@ -155,6 +160,14 @@
    (let [b (.readBoolean (:in @conn))]
      b))
 
+(defn -read-double [conn]
+   (let [i (.readDouble (:in @conn))]
+     i))
+
+(defn -read-float [conn]
+   (let [i (.readFloat (:in @conn))]
+     i))
+
 (defn -read-string16 [conn]
   (let [str-len (.readShort (:in @conn))
         s (apply str (repeatedly str-len #(.readChar (:in @conn))))]