 
      IBufferLong
      (read-long [buff pos]
-       (if (= *byteorder* :little-endian)
+       (if (= *byte-order* :little-endian)
          (.getLongLE buff pos)
          (.getLong buff pos)))
      (write-long [buff pos value]
-       (if (= *byteorder* :little-endian)
+       (if (= *byte-order* :little-endian)
          (.setLongLE buff pos value)
          (.setLong buff pos value)))
      (read-ulong [buff pos]

   (extend-type ByteBuffer
     IBufferShort
     (read-short [buff pos]
       (set-current-bytebuffer-byteorder! buff)
       (.getShort buff pos))
     (write-short [buff pos value]
       (set-current-bytebuffer-byteorder! buff)
       (.putShort buff pos value))
     (read-ushort [buff pos]
       (set-current-bytebuffer-byteorder! buff)
       (let [val (.getShort buff pos)]
         (bit-and 0xFFFF (Integer. (int val)))))
     (write-ushort [buff pos value]
       (set-current-bytebuffer-byteorder! buff)
       (let [value (.shortValue (Integer. (int value)))]
         (.putShort buff pos value)))

     IBufferInt
     (read-int [buff pos]
       (set-current-bytebuffer-byteorder! buff)
       (.getInt buff pos))
     (write-int [buff pos value]
       (set-current-bytebuffer-byteorder! buff)
       (.putInt buff pos value))
     (read-uint [buff pos]
       (set-current-bytebuffer-byteorder! buff)
       (let [val (.getInt buff pos)]
         (bit-and 0xFFFFFFFF (Long. (long val)))))
     (write-uint [buff pos value]
       (set-current-bytebuffer-byteorder! buff)
       (let [value (.intValue (Long. (long value)))]
         (.putInt buff pos value)))

     IBufferLong
     (read-long [buff pos]
       (set-current-bytebuffer-byteorder! buff)
       (.getLong buff pos))
     (write-long [buff pos value]
       (set-current-bytebuffer-byteorder! buff)
       (.putLong buff pos value))
     (read-ulong [buff pos]
       (set-current-bytebuffer-byteorder! buff)
       (let [val (.getLong buff pos)
             ^bytes magnitude (-> (ByteBuffer/allocate 8) (.putLong val) .array)]
         (bigint (BigInteger. 1 magnitude))))
     (write-ulong [buff pos value]
       (set-current-bytebuffer-byteorder! buff)
       (let [value (.longValue (bigint value))]
         (.putLong buff pos value)))

     IBufferFloat
     (read-float [buff pos]
       (set-current-bytebuffer-byteorder! buff)
       (.getFloat buff pos))
     (write-float [buff pos value]
       (set-current-bytebuffer-byteorder! buff)
       (.putFloat buff pos value))

     IBufferDouble
     (read-double [buff pos]
       (set-current-bytebuffer-byteorder! buff)
       (.getDouble buff pos))
     (write-double [buff pos value]
       (set-current-bytebuffer-byteorder! buff)
       (.putDouble buff pos value))

     IBufferByte
     (read-byte [buff pos]
       (set-current-bytebuffer-byteorder! buff)
       (.get buff pos))
     (write-byte [buff pos value]
       (set-current-bytebuffer-byteorder! buff)
       (.put buff pos value))
     (read-ubyte [buff pos]
       (set-current-bytebuffer-byteorder! buff)
       (let [val (.get buff pos)]
         (bit-and 0xFF (short val))))
     (write-ubyte [buff pos value]
       (set-current-bytebuffer-byteorder! buff)
       (let [value (.byteValue (Short. (short value)))]
         (.put buff pos value)))


   (extend-type ByteBuf
     IBufferShort
     (read-short [buff pos]
       (if (= *byte-order* :little-endian)
         (.getShortLE buff pos)
         (.getShort buff pos)))
     (write-short [buff pos value]
       (if (= *byte-order* :little-endian)
         (.setShortLE buff pos value)
         (.setShort buff pos value)))
     (read-ushort [buff pos]
