 
 
 ; Reading Data ---------------------------------------------------------------------
-(defn red-byte [conn]
+(defn -read-byte [conn]
    (let [b (.readByte (:in @conn))]
      b))
 
-(defn red-int [conn]
+(defn -read-int [conn]
    (let [i (.readInt (:in @conn))]
      i))
 
-(defn red-long [conn]
+(defn -read-long [conn]
    (let [i (.readLong (:in @conn))]
      i))
 
-(defn red-string16 [conn]
+(defn -read-string16 [conn]
   (let [str-len (.readShort (:in @conn))
         s (apply str (repeatedly str-len #(.readChar (:in @conn))))]
     s))

            (= packet-type :keepalive) (read-packet-keepalive conn)
            (= packet-type :handshake) (read-packet-handshake conn)
            (= packet-type :login) (read-packet-login conn)
            :else (str "UNKNOWN PACKET TYPE: " packet-id)
            ))
        (println "\n\n\n")))


; Writing Packets ------------------------------------------------------------------
(defn write-packet-keepalive [conn _]
      (-write-byte conn (:handshake packet-ids)))

(defn write-packet-handshake [conn {username :username}]
      (-write-byte conn (:handshake packet-ids))

      (-write-string16 conn username))

(defn write-packet-login [conn {version :version, username :username}]
      (-write-byte conn (:login packet-ids))

      (-write-int conn version)
      (-write-string16 conn username)
      (-write-long conn 0)
      (-write-byte conn 0))

(defn write-packet-chat [conn {message :message}]
      (-write-byte conn (:chat packet-ids))

      (-write-string16 conn message))


; Writing Wrappers -----------------------------------------------------------------
