// Compiled by ClojureScript 1.9.562 {}
goog.provide('octet.buffer');
goog.require('cljs.core');
/**
 * Defines the default byte order used for the write and read
 *   operations on the byte buffers.
 */
octet.buffer._STAR_byte_order_STAR_ = new cljs.core.Keyword(null,"big-endian","big-endian",-1086482881);

/**
 * @interface
 */
octet.buffer.IBufferShort = function(){};

/**
 * Read short integer (16 bits) from buffer.
 */
octet.buffer.read_short = (function octet$buffer$read_short(_,pos){
if((!((_ == null))) && (!((_.octet$buffer$IBufferShort$read_short$arity$2 == null)))){
return _.octet$buffer$IBufferShort$read_short$arity$2(_,pos);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.read_short[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos);
} else {
var m__24057__auto____$1 = (octet.buffer.read_short["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferShort.read-short",_);
}
}
}
});

/**
 * Write a short integer to the buffer.
 */
octet.buffer.write_short = (function octet$buffer$write_short(_,pos,value){
if((!((_ == null))) && (!((_.octet$buffer$IBufferShort$write_short$arity$3 == null)))){
return _.octet$buffer$IBufferShort$write_short$arity$3(_,pos,value);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.write_short[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos,value);
} else {
var m__24057__auto____$1 = (octet.buffer.write_short["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos,value);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferShort.write-short",_);
}
}
}
});

/**
 * Read unsigned short integer (16 bits) from buffer.
 */
octet.buffer.read_ushort = (function octet$buffer$read_ushort(_,pos){
if((!((_ == null))) && (!((_.octet$buffer$IBufferShort$read_ushort$arity$2 == null)))){
return _.octet$buffer$IBufferShort$read_ushort$arity$2(_,pos);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.read_ushort[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos);
} else {
var m__24057__auto____$1 = (octet.buffer.read_ushort["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferShort.read-ushort",_);
}
}
}
});

/**
 * Write a unsigned short integer to the buffer.
 */
octet.buffer.write_ushort = (function octet$buffer$write_ushort(_,pos,value){
if((!((_ == null))) && (!((_.octet$buffer$IBufferShort$write_ushort$arity$3 == null)))){
return _.octet$buffer$IBufferShort$write_ushort$arity$3(_,pos,value);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.write_ushort[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos,value);
} else {
var m__24057__auto____$1 = (octet.buffer.write_ushort["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos,value);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferShort.write-ushort",_);
}
}
}
});


/**
 * @interface
 */
octet.buffer.IBufferInt = function(){};

/**
 * Read an integer (32 bits) from buffer.
 */
octet.buffer.read_int = (function octet$buffer$read_int(_,pos){
if((!((_ == null))) && (!((_.octet$buffer$IBufferInt$read_int$arity$2 == null)))){
return _.octet$buffer$IBufferInt$read_int$arity$2(_,pos);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.read_int[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos);
} else {
var m__24057__auto____$1 = (octet.buffer.read_int["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferInt.read-int",_);
}
}
}
});

/**
 * Write an integer to the buffer.
 */
octet.buffer.write_int = (function octet$buffer$write_int(_,pos,value){
if((!((_ == null))) && (!((_.octet$buffer$IBufferInt$write_int$arity$3 == null)))){
return _.octet$buffer$IBufferInt$write_int$arity$3(_,pos,value);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.write_int[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos,value);
} else {
var m__24057__auto____$1 = (octet.buffer.write_int["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos,value);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferInt.write-int",_);
}
}
}
});

/**
 * Read an unsigned integer (32 bits) from buffer.
 */
octet.buffer.read_uint = (function octet$buffer$read_uint(_,pos){
if((!((_ == null))) && (!((_.octet$buffer$IBufferInt$read_uint$arity$2 == null)))){
return _.octet$buffer$IBufferInt$read_uint$arity$2(_,pos);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.read_uint[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos);
} else {
var m__24057__auto____$1 = (octet.buffer.read_uint["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferInt.read-uint",_);
}
}
}
});

/**
 * Write an unsigned integer to the buffer.
 */
octet.buffer.write_uint = (function octet$buffer$write_uint(_,pos,value){
if((!((_ == null))) && (!((_.octet$buffer$IBufferInt$write_uint$arity$3 == null)))){
return _.octet$buffer$IBufferInt$write_uint$arity$3(_,pos,value);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.write_uint[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos,value);
} else {
var m__24057__auto____$1 = (octet.buffer.write_uint["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos,value);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferInt.write-uint",_);
}
}
}
});


/**
 * @interface
 */
octet.buffer.IBufferLong = function(){};

/**
 * Read an long (64 bits) from buffer.
 */
octet.buffer.read_long = (function octet$buffer$read_long(_,pos){
if((!((_ == null))) && (!((_.octet$buffer$IBufferLong$read_long$arity$2 == null)))){
return _.octet$buffer$IBufferLong$read_long$arity$2(_,pos);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.read_long[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos);
} else {
var m__24057__auto____$1 = (octet.buffer.read_long["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferLong.read-long",_);
}
}
}
});

/**
 * Write a long to the buffer.
 */
octet.buffer.write_long = (function octet$buffer$write_long(_,pos,value){
if((!((_ == null))) && (!((_.octet$buffer$IBufferLong$write_long$arity$3 == null)))){
return _.octet$buffer$IBufferLong$write_long$arity$3(_,pos,value);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.write_long[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos,value);
} else {
var m__24057__auto____$1 = (octet.buffer.write_long["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos,value);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferLong.write-long",_);
}
}
}
});

/**
 * Read an unsigned long (64 bits) from buffer.
 */
octet.buffer.read_ulong = (function octet$buffer$read_ulong(_,pos){
if((!((_ == null))) && (!((_.octet$buffer$IBufferLong$read_ulong$arity$2 == null)))){
return _.octet$buffer$IBufferLong$read_ulong$arity$2(_,pos);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.read_ulong[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos);
} else {
var m__24057__auto____$1 = (octet.buffer.read_ulong["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferLong.read-ulong",_);
}
}
}
});

/**
 * Write an unsigned long to the buffer.
 */
octet.buffer.write_ulong = (function octet$buffer$write_ulong(_,pos,value){
if((!((_ == null))) && (!((_.octet$buffer$IBufferLong$write_ulong$arity$3 == null)))){
return _.octet$buffer$IBufferLong$write_ulong$arity$3(_,pos,value);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.write_ulong[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos,value);
} else {
var m__24057__auto____$1 = (octet.buffer.write_ulong["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos,value);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferLong.write-ulong",_);
}
}
}
});


/**
 * @interface
 */
octet.buffer.IBufferFloat = function(){};

/**
 * Read an float (32 bits) from buffer.
 */
octet.buffer.read_float = (function octet$buffer$read_float(_,pos){
if((!((_ == null))) && (!((_.octet$buffer$IBufferFloat$read_float$arity$2 == null)))){
return _.octet$buffer$IBufferFloat$read_float$arity$2(_,pos);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.read_float[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos);
} else {
var m__24057__auto____$1 = (octet.buffer.read_float["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferFloat.read-float",_);
}
}
}
});

/**
 * Write a float to the buffer.
 */
octet.buffer.write_float = (function octet$buffer$write_float(_,pos,value){
if((!((_ == null))) && (!((_.octet$buffer$IBufferFloat$write_float$arity$3 == null)))){
return _.octet$buffer$IBufferFloat$write_float$arity$3(_,pos,value);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.write_float[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos,value);
} else {
var m__24057__auto____$1 = (octet.buffer.write_float["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos,value);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferFloat.write-float",_);
}
}
}
});


/**
 * @interface
 */
octet.buffer.IBufferDouble = function(){};

/**
 * Read an double (64 bits) from buffer.
 */
octet.buffer.read_double = (function octet$buffer$read_double(_,pos){
if((!((_ == null))) && (!((_.octet$buffer$IBufferDouble$read_double$arity$2 == null)))){
return _.octet$buffer$IBufferDouble$read_double$arity$2(_,pos);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.read_double[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos);
} else {
var m__24057__auto____$1 = (octet.buffer.read_double["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferDouble.read-double",_);
}
}
}
});

/**
 * Write a double to the buffer.
 */
octet.buffer.write_double = (function octet$buffer$write_double(_,pos,value){
if((!((_ == null))) && (!((_.octet$buffer$IBufferDouble$write_double$arity$3 == null)))){
return _.octet$buffer$IBufferDouble$write_double$arity$3(_,pos,value);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.write_double[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos,value);
} else {
var m__24057__auto____$1 = (octet.buffer.write_double["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos,value);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferDouble.write-double",_);
}
}
}
});


/**
 * @interface
 */
octet.buffer.IBufferByte = function(){};

/**
 * Read one byte from buffer.
 */
octet.buffer.read_byte = (function octet$buffer$read_byte(_,pos){
if((!((_ == null))) && (!((_.octet$buffer$IBufferByte$read_byte$arity$2 == null)))){
return _.octet$buffer$IBufferByte$read_byte$arity$2(_,pos);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.read_byte[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos);
} else {
var m__24057__auto____$1 = (octet.buffer.read_byte["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferByte.read-byte",_);
}
}
}
});

/**
 * Write one byte to the buffer.
 */
octet.buffer.write_byte = (function octet$buffer$write_byte(_,pos,value){
if((!((_ == null))) && (!((_.octet$buffer$IBufferByte$write_byte$arity$3 == null)))){
return _.octet$buffer$IBufferByte$write_byte$arity$3(_,pos,value);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.write_byte[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos,value);
} else {
var m__24057__auto____$1 = (octet.buffer.write_byte["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos,value);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferByte.write-byte",_);
}
}
}
});

/**
 * Read one unsigned byte from buffer.
 */
octet.buffer.read_ubyte = (function octet$buffer$read_ubyte(_,pos){
if((!((_ == null))) && (!((_.octet$buffer$IBufferByte$read_ubyte$arity$2 == null)))){
return _.octet$buffer$IBufferByte$read_ubyte$arity$2(_,pos);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.read_ubyte[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos);
} else {
var m__24057__auto____$1 = (octet.buffer.read_ubyte["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferByte.read-ubyte",_);
}
}
}
});

/**
 * Write one unsigned byte to the buffer.
 */
octet.buffer.write_ubyte = (function octet$buffer$write_ubyte(_,pos,value){
if((!((_ == null))) && (!((_.octet$buffer$IBufferByte$write_ubyte$arity$3 == null)))){
return _.octet$buffer$IBufferByte$write_ubyte$arity$3(_,pos,value);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.write_ubyte[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos,value);
} else {
var m__24057__auto____$1 = (octet.buffer.write_ubyte["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos,value);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferByte.write-ubyte",_);
}
}
}
});


/**
 * @interface
 */
octet.buffer.IBufferBytes = function(){};

/**
 * Read a byte array.
 */
octet.buffer.read_bytes = (function octet$buffer$read_bytes(_,pos,size){
if((!((_ == null))) && (!((_.octet$buffer$IBufferBytes$read_bytes$arity$3 == null)))){
return _.octet$buffer$IBufferBytes$read_bytes$arity$3(_,pos,size);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.read_bytes[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos,size);
} else {
var m__24057__auto____$1 = (octet.buffer.read_bytes["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos,size);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferBytes.read-bytes",_);
}
}
}
});

/**
 * Write byte array.
 */
octet.buffer.write_bytes = (function octet$buffer$write_bytes(_,pos,size,data){
if((!((_ == null))) && (!((_.octet$buffer$IBufferBytes$write_bytes$arity$4 == null)))){
return _.octet$buffer$IBufferBytes$write_bytes$arity$4(_,pos,size,data);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.write_bytes[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_,pos,size,data);
} else {
var m__24057__auto____$1 = (octet.buffer.write_bytes["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_,pos,size,data);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferBytes.write-bytes",_);
}
}
}
});


/**
 * @interface
 */
octet.buffer.IBufferLimit = function(){};

/**
 * Get the read/write capacity in bytes.
 */
octet.buffer.get_capacity = (function octet$buffer$get_capacity(_){
if((!((_ == null))) && (!((_.octet$buffer$IBufferLimit$get_capacity$arity$1 == null)))){
return _.octet$buffer$IBufferLimit$get_capacity$arity$1(_);
} else {
var x__24056__auto__ = (((_ == null))?null:_);
var m__24057__auto__ = (octet.buffer.get_capacity[goog.typeOf(x__24056__auto__)]);
if(!((m__24057__auto__ == null))){
return m__24057__auto__.call(null,_);
} else {
var m__24057__auto____$1 = (octet.buffer.get_capacity["_"]);
if(!((m__24057__auto____$1 == null))){
return m__24057__auto____$1.call(null,_);
} else {
throw cljs.core.missing_protocol.call(null,"IBufferLimit.get-capacity",_);
}
}
}
});

octet.buffer.stream_operation = (function octet$buffer$stream_operation(opfn,buff,pos){
return cljs.core.reduce.call(null,(function (pos__$1,buff__$1){
var buffsize = octet.buffer.get_capacity.call(null,buff__$1);
if((pos__$1 >= buffsize)){
return (pos__$1 - buffsize);
} else {
return cljs.core.reduced.call(null,opfn.call(null,buff__$1,pos__$1));
}
}),pos,buff);
});
cljs.core.PersistentVector.prototype.octet$buffer$IBufferShort$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.PersistentVector.prototype.octet$buffer$IBufferShort$read_short$arity$2 = (function (buff,pos){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34038_SHARP_){
if(!((p1__34038_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34038_SHARP_.octet$buffer$IBufferShort$))){
return true;
} else {
if((!p1__34038_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34038_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34038_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34038#] (satisfies? IBufferShort p1__34038#)) buff)"));
}

return octet.buffer.stream_operation.call(null,octet.buffer.read_short,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferShort$write_short$arity$3 = (function (buff,pos,value){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34039_SHARP_){
if(!((p1__34039_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34039_SHARP_.octet$buffer$IBufferShort$))){
return true;
} else {
if((!p1__34039_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34039_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34039_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34039#] (satisfies? IBufferShort p1__34039#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34040_SHARP_,p2__34041_SHARP_){
return octet.buffer.write_short.call(null,p1__34040_SHARP_,p2__34041_SHARP_,value);
});})(buff__$1))
,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferShort$read_ushort$arity$2 = (function (buff,pos){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34042_SHARP_){
if(!((p1__34042_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34042_SHARP_.octet$buffer$IBufferShort$))){
return true;
} else {
if((!p1__34042_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34042_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34042_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34042#] (satisfies? IBufferShort p1__34042#)) buff)"));
}

return octet.buffer.stream_operation.call(null,octet.buffer.read_ushort,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferShort$write_ushort$arity$3 = (function (buff,pos,value){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34043_SHARP_){
if(!((p1__34043_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34043_SHARP_.octet$buffer$IBufferShort$))){
return true;
} else {
if((!p1__34043_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34043_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34043_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34043#] (satisfies? IBufferShort p1__34043#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34044_SHARP_,p2__34045_SHARP_){
return octet.buffer.write_ushort.call(null,p1__34044_SHARP_,p2__34045_SHARP_,value);
});})(buff__$1))
,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferInt$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.PersistentVector.prototype.octet$buffer$IBufferInt$read_int$arity$2 = (function (buff,pos){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34046_SHARP_){
if(!((p1__34046_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34046_SHARP_.octet$buffer$IBufferInt$))){
return true;
} else {
if((!p1__34046_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34046_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34046_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34046#] (satisfies? IBufferInt p1__34046#)) buff)"));
}

return octet.buffer.stream_operation.call(null,octet.buffer.read_int,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferInt$write_int$arity$3 = (function (buff,pos,value){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34047_SHARP_){
if(!((p1__34047_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34047_SHARP_.octet$buffer$IBufferInt$))){
return true;
} else {
if((!p1__34047_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34047_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34047_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34047#] (satisfies? IBufferInt p1__34047#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34048_SHARP_,p2__34049_SHARP_){
return octet.buffer.write_int.call(null,p1__34048_SHARP_,p2__34049_SHARP_,value);
});})(buff__$1))
,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferInt$read_uint$arity$2 = (function (buff,pos){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34050_SHARP_){
if(!((p1__34050_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34050_SHARP_.octet$buffer$IBufferInt$))){
return true;
} else {
if((!p1__34050_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34050_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34050_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34050#] (satisfies? IBufferInt p1__34050#)) buff)"));
}

return octet.buffer.stream_operation.call(null,octet.buffer.read_uint,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferInt$write_uint$arity$3 = (function (buff,pos,value){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34051_SHARP_){
if(!((p1__34051_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34051_SHARP_.octet$buffer$IBufferInt$))){
return true;
} else {
if((!p1__34051_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34051_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34051_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34051#] (satisfies? IBufferInt p1__34051#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34052_SHARP_,p2__34053_SHARP_){
return octet.buffer.write_uint.call(null,p1__34052_SHARP_,p2__34053_SHARP_,value);
});})(buff__$1))
,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferLong$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.PersistentVector.prototype.octet$buffer$IBufferLong$read_long$arity$2 = (function (buff,pos){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34054_SHARP_){
if(!((p1__34054_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34054_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34054_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34054_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34054_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34054#] (satisfies? IBufferLong p1__34054#)) buff)"));
}

return octet.buffer.stream_operation.call(null,octet.buffer.read_long,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferLong$write_long$arity$3 = (function (buff,pos,value){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34055_SHARP_){
if(!((p1__34055_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34055_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34055_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34055_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34055_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34055#] (satisfies? IBufferLong p1__34055#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34056_SHARP_,p2__34057_SHARP_){
return octet.buffer.write_long.call(null,p1__34056_SHARP_,p2__34057_SHARP_,value);
});})(buff__$1))
,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferLong$read_ulong$arity$2 = (function (buff,pos){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34058_SHARP_){
if(!((p1__34058_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34058_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34058_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34058_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34058_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34058#] (satisfies? IBufferLong p1__34058#)) buff)"));
}

return octet.buffer.stream_operation.call(null,octet.buffer.read_ulong,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferLong$write_ulong$arity$3 = (function (buff,pos,value){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34059_SHARP_){
if(!((p1__34059_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34059_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34059_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34059_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34059_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34059#] (satisfies? IBufferLong p1__34059#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34060_SHARP_,p2__34061_SHARP_){
return octet.buffer.write_ulong.call(null,p1__34060_SHARP_,p2__34061_SHARP_,value);
});})(buff__$1))
,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferFloat$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.PersistentVector.prototype.octet$buffer$IBufferFloat$read_float$arity$2 = (function (buff,pos){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34062_SHARP_){
if(!((p1__34062_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34062_SHARP_.octet$buffer$IBufferFloat$))){
return true;
} else {
if((!p1__34062_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferFloat,p1__34062_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferFloat,p1__34062_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34062#] (satisfies? IBufferFloat p1__34062#)) buff)"));
}

return octet.buffer.stream_operation.call(null,octet.buffer.read_float,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferFloat$write_float$arity$3 = (function (buff,pos,value){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34063_SHARP_){
if(!((p1__34063_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34063_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34063_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34063_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34063_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34063#] (satisfies? IBufferLong p1__34063#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34064_SHARP_,p2__34065_SHARP_){
return octet.buffer.write_float.call(null,p1__34064_SHARP_,p2__34065_SHARP_,value);
});})(buff__$1))
,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferDouble$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.PersistentVector.prototype.octet$buffer$IBufferDouble$read_double$arity$2 = (function (buff,pos){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34066_SHARP_){
if(!((p1__34066_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34066_SHARP_.octet$buffer$IBufferDouble$))){
return true;
} else {
if((!p1__34066_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__34066_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__34066_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34066#] (satisfies? IBufferDouble p1__34066#)) buff)"));
}

return octet.buffer.stream_operation.call(null,octet.buffer.read_double,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferDouble$write_double$arity$3 = (function (buff,pos,value){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34067_SHARP_){
if(!((p1__34067_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34067_SHARP_.octet$buffer$IBufferDouble$))){
return true;
} else {
if((!p1__34067_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__34067_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__34067_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34067#] (satisfies? IBufferDouble p1__34067#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34068_SHARP_,p2__34069_SHARP_){
return octet.buffer.write_double.call(null,p1__34068_SHARP_,p2__34069_SHARP_,value);
});})(buff__$1))
,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferByte$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.PersistentVector.prototype.octet$buffer$IBufferByte$read_byte$arity$2 = (function (buff,pos){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34070_SHARP_){
if(!((p1__34070_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34070_SHARP_.octet$buffer$IBufferByte$))){
return true;
} else {
if((!p1__34070_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34070_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34070_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34070#] (satisfies? IBufferByte p1__34070#)) buff)"));
}

return octet.buffer.stream_operation.call(null,octet.buffer.read_byte,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferByte$write_byte$arity$3 = (function (buff,pos,value){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34071_SHARP_){
if(!((p1__34071_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34071_SHARP_.octet$buffer$IBufferByte$))){
return true;
} else {
if((!p1__34071_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34071_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34071_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34071#] (satisfies? IBufferByte p1__34071#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34072_SHARP_,p2__34073_SHARP_){
return octet.buffer.write_byte.call(null,p1__34072_SHARP_,p2__34073_SHARP_,value);
});})(buff__$1))
,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferByte$read_ubyte$arity$2 = (function (buff,pos){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34074_SHARP_){
if(!((p1__34074_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34074_SHARP_.octet$buffer$IBufferByte$))){
return true;
} else {
if((!p1__34074_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34074_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34074_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34074#] (satisfies? IBufferByte p1__34074#)) buff)"));
}

return octet.buffer.stream_operation.call(null,octet.buffer.read_ubyte,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferByte$write_ubyte$arity$3 = (function (buff,pos,value){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34075_SHARP_){
if(!((p1__34075_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34075_SHARP_.octet$buffer$IBufferByte$))){
return true;
} else {
if((!p1__34075_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34075_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34075_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34075#] (satisfies? IBufferByte p1__34075#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34076_SHARP_,p2__34077_SHARP_){
return octet.buffer.write_ubyte.call(null,p1__34076_SHARP_,p2__34077_SHARP_,value);
});})(buff__$1))
,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferBytes$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.PersistentVector.prototype.octet$buffer$IBufferBytes$read_bytes$arity$3 = (function (buff,pos,size){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34078_SHARP_){
if(!((p1__34078_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34078_SHARP_.octet$buffer$IBufferBytes$))){
return true;
} else {
if((!p1__34078_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferBytes,p1__34078_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferBytes,p1__34078_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34078#] (satisfies? IBufferBytes p1__34078#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34079_SHARP_,p2__34080_SHARP_){
return octet.buffer.read_bytes.call(null,p1__34079_SHARP_,p2__34080_SHARP_,size);
});})(buff__$1))
,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferBytes$write_bytes$arity$4 = (function (buff,pos,size,data){
var buff__$1 = this;
if(cljs.core.every_QMARK_.call(null,((function (buff__$1){
return (function (p1__34081_SHARP_){
if(!((p1__34081_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34081_SHARP_.octet$buffer$IBufferByte$))){
return true;
} else {
if((!p1__34081_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34081_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34081_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34081#] (satisfies? IBufferByte p1__34081#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34082_SHARP_,p2__34083_SHARP_){
return octet.buffer.write_bytes.call(null,p1__34082_SHARP_,p2__34083_SHARP_,size,data);
});})(buff__$1))
,buff__$1,pos);
});

cljs.core.PersistentVector.prototype.octet$buffer$IBufferLimit$ = cljs.core.PROTOCOL_SENTINEL;

cljs.core.PersistentVector.prototype.octet$buffer$IBufferLimit$get_capacity$arity$1 = (function (buff){
var buff__$1 = this;
return cljs.core.reduce.call(null,((function (buff__$1){
return (function (p1__34084_SHARP_,p2__34085_SHARP_){
return (p1__34084_SHARP_ + octet.buffer.get_capacity.call(null,p2__34085_SHARP_));
});})(buff__$1))
,(0),buff__$1);
});
DataView.prototype.octet$buffer$IBufferShort$ = cljs.core.PROTOCOL_SENTINEL;

DataView.prototype.octet$buffer$IBufferShort$read_short$arity$2 = (function (buff,pos){
var buff__$1 = this;
return buff__$1.getInt16(pos,cljs.core._EQ_.call(null,octet.buffer._STAR_byte_order_STAR_,new cljs.core.Keyword(null,"little-endian","little-endian",1877303413)));
});

DataView.prototype.octet$buffer$IBufferShort$write_short$arity$3 = (function (buff,pos,value){
var buff__$1 = this;
return buff__$1.setInt16(pos,value,cljs.core._EQ_.call(null,octet.buffer._STAR_byte_order_STAR_,new cljs.core.Keyword(null,"little-endian","little-endian",1877303413)));
});

DataView.prototype.octet$buffer$IBufferShort$read_ushort$arity$2 = (function (buff,pos){
var buff__$1 = this;
return buff__$1.getUint16(pos,cljs.core._EQ_.call(null,octet.buffer._STAR_byte_order_STAR_,new cljs.core.Keyword(null,"little-endian","little-endian",1877303413)));
});

DataView.prototype.octet$buffer$IBufferShort$write_ushort$arity$3 = (function (buff,pos,value){
var buff__$1 = this;
return buff__$1.setUint16(pos,value,cljs.core._EQ_.call(null,octet.buffer._STAR_byte_order_STAR_,new cljs.core.Keyword(null,"little-endian","little-endian",1877303413)));
});

DataView.prototype.octet$buffer$IBufferInt$ = cljs.core.PROTOCOL_SENTINEL;

DataView.prototype.octet$buffer$IBufferInt$read_int$arity$2 = (function (buff,pos){
var buff__$1 = this;
return buff__$1.getInt32(pos,cljs.core._EQ_.call(null,octet.buffer._STAR_byte_order_STAR_,new cljs.core.Keyword(null,"little-endian","little-endian",1877303413)));
});

DataView.prototype.octet$buffer$IBufferInt$write_int$arity$3 = (function (buff,pos,value){
var buff__$1 = this;
return buff__$1.setInt32(pos,value,cljs.core._EQ_.call(null,octet.buffer._STAR_byte_order_STAR_,new cljs.core.Keyword(null,"little-endian","little-endian",1877303413)));
});

DataView.prototype.octet$buffer$IBufferInt$read_uint$arity$2 = (function (buff,pos){
var buff__$1 = this;
return buff__$1.getUint32(pos,cljs.core._EQ_.call(null,octet.buffer._STAR_byte_order_STAR_,new cljs.core.Keyword(null,"little-endian","little-endian",1877303413)));
});

DataView.prototype.octet$buffer$IBufferInt$write_uint$arity$3 = (function (buff,pos,value){
var buff__$1 = this;
return buff__$1.setUint32(pos,value,cljs.core._EQ_.call(null,octet.buffer._STAR_byte_order_STAR_,new cljs.core.Keyword(null,"little-endian","little-endian",1877303413)));
});

DataView.prototype.octet$buffer$IBufferFloat$ = cljs.core.PROTOCOL_SENTINEL;

DataView.prototype.octet$buffer$IBufferFloat$read_float$arity$2 = (function (buff,pos){
var buff__$1 = this;
return buff__$1.getFloat32(pos,cljs.core._EQ_.call(null,octet.buffer._STAR_byte_order_STAR_,new cljs.core.Keyword(null,"little-endian","little-endian",1877303413)));
});

DataView.prototype.octet$buffer$IBufferFloat$write_float$arity$3 = (function (buff,pos,value){
var buff__$1 = this;
return buff__$1.setFloat32(pos,value,cljs.core._EQ_.call(null,octet.buffer._STAR_byte_order_STAR_,new cljs.core.Keyword(null,"little-endian","little-endian",1877303413)));
});

DataView.prototype.octet$buffer$IBufferDouble$ = cljs.core.PROTOCOL_SENTINEL;

DataView.prototype.octet$buffer$IBufferDouble$read_double$arity$2 = (function (buff,pos){
var buff__$1 = this;
return buff__$1.getFloat64(pos,cljs.core._EQ_.call(null,octet.buffer._STAR_byte_order_STAR_,new cljs.core.Keyword(null,"little-endian","little-endian",1877303413)));
});

DataView.prototype.octet$buffer$IBufferDouble$write_double$arity$3 = (function (buff,pos,value){
var buff__$1 = this;
return buff__$1.setFloat64(pos,value,cljs.core._EQ_.call(null,octet.buffer._STAR_byte_order_STAR_,new cljs.core.Keyword(null,"little-endian","little-endian",1877303413)));
});

DataView.prototype.octet$buffer$IBufferByte$ = cljs.core.PROTOCOL_SENTINEL;

DataView.prototype.octet$buffer$IBufferByte$read_byte$arity$2 = (function (buff,pos){
var buff__$1 = this;
return buff__$1.getInt8(pos);
});

DataView.prototype.octet$buffer$IBufferByte$write_byte$arity$3 = (function (buff,pos,value){
var buff__$1 = this;
return buff__$1.setInt8(pos,value);
});

DataView.prototype.octet$buffer$IBufferByte$read_ubyte$arity$2 = (function (buff,pos){
var buff__$1 = this;
return buff__$1.getUint8(pos);
});

DataView.prototype.octet$buffer$IBufferByte$write_ubyte$arity$3 = (function (buff,pos,value){
var buff__$1 = this;
return buff__$1.setUint8(pos,value);
});

DataView.prototype.octet$buffer$IBufferBytes$ = cljs.core.PROTOCOL_SENTINEL;

DataView.prototype.octet$buffer$IBufferBytes$read_bytes$arity$3 = (function (buff,pos,size){
var buff__$1 = this;
var offset = buff__$1.byteOffset;
var buffer = buff__$1.buffer;
return (new Int8Array(buffer,(offset + pos),size));
});

DataView.prototype.octet$buffer$IBufferBytes$write_bytes$arity$4 = (function (buff,pos,size,data){
var buff__$1 = this;
var seq__34108 = cljs.core.seq.call(null,cljs.core.range.call(null,data.length));
var chunk__34109 = null;
var count__34110 = (0);
var i__34111 = (0);
while(true){
if((i__34111 < count__34110)){
var i = cljs.core._nth.call(null,chunk__34109,i__34111);
buff__$1.setInt8((pos + i),(data[i]));

var G__34112 = seq__34108;
var G__34113 = chunk__34109;
var G__34114 = count__34110;
var G__34115 = (i__34111 + (1));
seq__34108 = G__34112;
chunk__34109 = G__34113;
count__34110 = G__34114;
i__34111 = G__34115;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__34108);
if(temp__5278__auto__){
var seq__34108__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__34108__$1)){
var c__24249__auto__ = cljs.core.chunk_first.call(null,seq__34108__$1);
var G__34116 = cljs.core.chunk_rest.call(null,seq__34108__$1);
var G__34117 = c__24249__auto__;
var G__34118 = cljs.core.count.call(null,c__24249__auto__);
var G__34119 = (0);
seq__34108 = G__34116;
chunk__34109 = G__34117;
count__34110 = G__34118;
i__34111 = G__34119;
continue;
} else {
var i = cljs.core.first.call(null,seq__34108__$1);
buff__$1.setInt8((pos + i),(data[i]));

var G__34120 = cljs.core.next.call(null,seq__34108__$1);
var G__34121 = null;
var G__34122 = (0);
var G__34123 = (0);
seq__34108 = G__34120;
chunk__34109 = G__34121;
count__34110 = G__34122;
i__34111 = G__34123;
continue;
}
} else {
return null;
}
}
break;
}
});

DataView.prototype.octet$buffer$IBufferLimit$ = cljs.core.PROTOCOL_SENTINEL;

DataView.prototype.octet$buffer$IBufferLimit$get_capacity$arity$1 = (function (buff){
var buff__$1 = this;
return buff__$1.byteLength;
});
if(typeof octet.buffer.allocate !== 'undefined'){
} else {
/**
 * Polymorphic function for allocate new bytebuffers.
 * 
 *   It allows allocate using different implementation
 *   of bytebuffers and different types of them.
 * 
 *   As example, you may want allocate nio direct buffer of 4 bytes:
 * 
 *    (allocate 4 {:type :direct :impl :nio})
 * 
 *   The supported options pairs are:
 * 
 *   - type: `:heap`, impl: `:nio` (default)
 *   - type: `:direct`, impl: `:nio`
 *   - type: `:heap`, impl: `:netty`
 *   - type: `:direct`, impl: `:netty`
 *   - impl: `:es6` (clojurescript) (default)
 * 
 *   This function is defined as multimethod and you can
 *   extend it with your own bytebuffer implementations
 *   if you want or need it.
 */
octet.buffer.allocate = (function (){var method_table__24369__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__24370__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__24371__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__24372__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__24373__auto__ = cljs.core.get.call(null,cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),cljs.core.get_global_hierarchy.call(null));
return (new cljs.core.MultiFn(cljs.core.symbol.call(null,"octet.buffer","allocate"),((function (method_table__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__auto__,hierarchy__24373__auto__){
return (function() { 
var G__34130__delegate = function (size,p__34124){
var vec__34125 = p__34124;
var map__34128 = cljs.core.nth.call(null,vec__34125,(0),null);
var map__34128__$1 = ((((!((map__34128 == null)))?((((map__34128.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__34128.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__34128):map__34128);
var type = cljs.core.get.call(null,map__34128__$1,new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"heap","heap",1039710192));
var impl = cljs.core.get.call(null,map__34128__$1,new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Keyword(null,"es6","es6",-1791209081));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [type,impl], null);
};
var G__34130 = function (size,var_args){
var p__34124 = null;
if (arguments.length > 1) {
var G__34131__i = 0, G__34131__a = new Array(arguments.length -  1);
while (G__34131__i < G__34131__a.length) {G__34131__a[G__34131__i] = arguments[G__34131__i + 1]; ++G__34131__i;}
  p__34124 = new cljs.core.IndexedSeq(G__34131__a,0,null);
} 
return G__34130__delegate.call(this,size,p__34124);};
G__34130.cljs$lang$maxFixedArity = 1;
G__34130.cljs$lang$applyTo = (function (arglist__34132){
var size = cljs.core.first(arglist__34132);
var p__34124 = cljs.core.rest(arglist__34132);
return G__34130__delegate(size,p__34124);
});
G__34130.cljs$core$IFn$_invoke$arity$variadic = G__34130__delegate;
return G__34130;
})()
;})(method_table__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__auto__,hierarchy__24373__auto__))
,new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__24373__auto__,method_table__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__auto__));
})();
}
cljs.core._add_method.call(null,octet.buffer.allocate,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"heap","heap",1039710192),new cljs.core.Keyword(null,"es6","es6",-1791209081)], null),(function() { 
var G__34133__delegate = function (size,_){
var bf = (new ArrayBuffer(size));
return (new DataView(bf));
};
var G__34133 = function (size,var_args){
var _ = null;
if (arguments.length > 1) {
var G__34134__i = 0, G__34134__a = new Array(arguments.length -  1);
while (G__34134__i < G__34134__a.length) {G__34134__a[G__34134__i] = arguments[G__34134__i + 1]; ++G__34134__i;}
  _ = new cljs.core.IndexedSeq(G__34134__a,0,null);
} 
return G__34133__delegate.call(this,size,_);};
G__34133.cljs$lang$maxFixedArity = 1;
G__34133.cljs$lang$applyTo = (function (arglist__34135){
var size = cljs.core.first(arglist__34135);
var _ = cljs.core.rest(arglist__34135);
return G__34133__delegate(size,_);
});
G__34133.cljs$core$IFn$_invoke$arity$variadic = G__34133__delegate;
return G__34133;
})()
);
