// 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__34140_SHARP_){
if(!((p1__34140_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34140_SHARP_.octet$buffer$IBufferShort$))){
return true;
} else {
if((!p1__34140_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34140_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34140_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34140#] (satisfies? IBufferShort p1__34140#)) 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__34141_SHARP_){
if(!((p1__34141_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34141_SHARP_.octet$buffer$IBufferShort$))){
return true;
} else {
if((!p1__34141_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34141_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34141_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34141#] (satisfies? IBufferShort p1__34141#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34142_SHARP_,p2__34143_SHARP_){
return octet.buffer.write_short.call(null,p1__34142_SHARP_,p2__34143_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__34144_SHARP_){
if(!((p1__34144_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34144_SHARP_.octet$buffer$IBufferShort$))){
return true;
} else {
if((!p1__34144_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34144_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34144_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34144#] (satisfies? IBufferShort p1__34144#)) 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__34145_SHARP_){
if(!((p1__34145_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34145_SHARP_.octet$buffer$IBufferShort$))){
return true;
} else {
if((!p1__34145_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34145_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34145_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34145#] (satisfies? IBufferShort p1__34145#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34146_SHARP_,p2__34147_SHARP_){
return octet.buffer.write_ushort.call(null,p1__34146_SHARP_,p2__34147_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__34148_SHARP_){
if(!((p1__34148_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34148_SHARP_.octet$buffer$IBufferInt$))){
return true;
} else {
if((!p1__34148_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34148_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34148_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34148#] (satisfies? IBufferInt p1__34148#)) 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__34149_SHARP_){
if(!((p1__34149_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34149_SHARP_.octet$buffer$IBufferInt$))){
return true;
} else {
if((!p1__34149_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34149_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34149_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34149#] (satisfies? IBufferInt p1__34149#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34150_SHARP_,p2__34151_SHARP_){
return octet.buffer.write_int.call(null,p1__34150_SHARP_,p2__34151_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__34152_SHARP_){
if(!((p1__34152_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34152_SHARP_.octet$buffer$IBufferInt$))){
return true;
} else {
if((!p1__34152_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34152_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34152_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34152#] (satisfies? IBufferInt p1__34152#)) 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__34153_SHARP_){
if(!((p1__34153_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34153_SHARP_.octet$buffer$IBufferInt$))){
return true;
} else {
if((!p1__34153_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34153_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34153_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34153#] (satisfies? IBufferInt p1__34153#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34154_SHARP_,p2__34155_SHARP_){
return octet.buffer.write_uint.call(null,p1__34154_SHARP_,p2__34155_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__34156_SHARP_){
if(!((p1__34156_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34156_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34156_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34156_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34156_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34156#] (satisfies? IBufferLong p1__34156#)) 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__34157_SHARP_){
if(!((p1__34157_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34157_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34157_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34157_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34157_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34157#] (satisfies? IBufferLong p1__34157#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34158_SHARP_,p2__34159_SHARP_){
return octet.buffer.write_long.call(null,p1__34158_SHARP_,p2__34159_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__34160_SHARP_){
if(!((p1__34160_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34160_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34160_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34160_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34160_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34160#] (satisfies? IBufferLong p1__34160#)) 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__34161_SHARP_){
if(!((p1__34161_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34161_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34161_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34161_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34161_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34161#] (satisfies? IBufferLong p1__34161#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34162_SHARP_,p2__34163_SHARP_){
return octet.buffer.write_ulong.call(null,p1__34162_SHARP_,p2__34163_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__34164_SHARP_){
if(!((p1__34164_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34164_SHARP_.octet$buffer$IBufferFloat$))){
return true;
} else {
if((!p1__34164_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferFloat,p1__34164_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferFloat,p1__34164_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34164#] (satisfies? IBufferFloat p1__34164#)) 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__34165_SHARP_){
if(!((p1__34165_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34165_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34165_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34165_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34165_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34165#] (satisfies? IBufferLong p1__34165#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34166_SHARP_,p2__34167_SHARP_){
return octet.buffer.write_float.call(null,p1__34166_SHARP_,p2__34167_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__34168_SHARP_){
if(!((p1__34168_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34168_SHARP_.octet$buffer$IBufferDouble$))){
return true;
} else {
if((!p1__34168_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__34168_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__34168_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34168#] (satisfies? IBufferDouble p1__34168#)) 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__34169_SHARP_){
if(!((p1__34169_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34169_SHARP_.octet$buffer$IBufferDouble$))){
return true;
} else {
if((!p1__34169_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__34169_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__34169_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34169#] (satisfies? IBufferDouble p1__34169#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34170_SHARP_,p2__34171_SHARP_){
return octet.buffer.write_double.call(null,p1__34170_SHARP_,p2__34171_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__34172_SHARP_){
if(!((p1__34172_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34172_SHARP_.octet$buffer$IBufferByte$))){
return true;
} else {
if((!p1__34172_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34172_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34172_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34172#] (satisfies? IBufferByte p1__34172#)) 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__34173_SHARP_){
if(!((p1__34173_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34173_SHARP_.octet$buffer$IBufferByte$))){
return true;
} else {
if((!p1__34173_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34173_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34173_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34173#] (satisfies? IBufferByte p1__34173#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34174_SHARP_,p2__34175_SHARP_){
return octet.buffer.write_byte.call(null,p1__34174_SHARP_,p2__34175_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__34176_SHARP_){
if(!((p1__34176_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34176_SHARP_.octet$buffer$IBufferByte$))){
return true;
} else {
if((!p1__34176_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34176_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34176_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34176#] (satisfies? IBufferByte p1__34176#)) 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__34177_SHARP_){
if(!((p1__34177_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34177_SHARP_.octet$buffer$IBufferByte$))){
return true;
} else {
if((!p1__34177_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34177_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34177_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34177#] (satisfies? IBufferByte p1__34177#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34178_SHARP_,p2__34179_SHARP_){
return octet.buffer.write_ubyte.call(null,p1__34178_SHARP_,p2__34179_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__34180_SHARP_){
if(!((p1__34180_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34180_SHARP_.octet$buffer$IBufferBytes$))){
return true;
} else {
if((!p1__34180_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferBytes,p1__34180_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferBytes,p1__34180_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34180#] (satisfies? IBufferBytes p1__34180#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34181_SHARP_,p2__34182_SHARP_){
return octet.buffer.read_bytes.call(null,p1__34181_SHARP_,p2__34182_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__34183_SHARP_){
if(!((p1__34183_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34183_SHARP_.octet$buffer$IBufferByte$))){
return true;
} else {
if((!p1__34183_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34183_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34183_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34183#] (satisfies? IBufferByte p1__34183#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34184_SHARP_,p2__34185_SHARP_){
return octet.buffer.write_bytes.call(null,p1__34184_SHARP_,p2__34185_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__34186_SHARP_,p2__34187_SHARP_){
return (p1__34186_SHARP_ + octet.buffer.get_capacity.call(null,p2__34187_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__34210 = cljs.core.seq.call(null,cljs.core.range.call(null,data.length));
var chunk__34211 = null;
var count__34212 = (0);
var i__34213 = (0);
while(true){
if((i__34213 < count__34212)){
var i = cljs.core._nth.call(null,chunk__34211,i__34213);
buff__$1.setInt8((pos + i),(data[i]));

var G__34214 = seq__34210;
var G__34215 = chunk__34211;
var G__34216 = count__34212;
var G__34217 = (i__34213 + (1));
seq__34210 = G__34214;
chunk__34211 = G__34215;
count__34212 = G__34216;
i__34213 = G__34217;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__34210);
if(temp__5278__auto__){
var seq__34210__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__34210__$1)){
var c__24249__auto__ = cljs.core.chunk_first.call(null,seq__34210__$1);
var G__34218 = cljs.core.chunk_rest.call(null,seq__34210__$1);
var G__34219 = c__24249__auto__;
var G__34220 = cljs.core.count.call(null,c__24249__auto__);
var G__34221 = (0);
seq__34210 = G__34218;
chunk__34211 = G__34219;
count__34212 = G__34220;
i__34213 = G__34221;
continue;
} else {
var i = cljs.core.first.call(null,seq__34210__$1);
buff__$1.setInt8((pos + i),(data[i]));

var G__34222 = cljs.core.next.call(null,seq__34210__$1);
var G__34223 = null;
var G__34224 = (0);
var G__34225 = (0);
seq__34210 = G__34222;
chunk__34211 = G__34223;
count__34212 = G__34224;
i__34213 = G__34225;
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__34232__delegate = function (size,p__34226){
var vec__34227 = p__34226;
var map__34230 = cljs.core.nth.call(null,vec__34227,(0),null);
var map__34230__$1 = ((((!((map__34230 == null)))?((((map__34230.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__34230.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__34230):map__34230);
var type = cljs.core.get.call(null,map__34230__$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__34230__$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__34232 = function (size,var_args){
var p__34226 = null;
if (arguments.length > 1) {
var G__34233__i = 0, G__34233__a = new Array(arguments.length -  1);
while (G__34233__i < G__34233__a.length) {G__34233__a[G__34233__i] = arguments[G__34233__i + 1]; ++G__34233__i;}
  p__34226 = new cljs.core.IndexedSeq(G__34233__a,0,null);
} 
return G__34232__delegate.call(this,size,p__34226);};
G__34232.cljs$lang$maxFixedArity = 1;
G__34232.cljs$lang$applyTo = (function (arglist__34234){
var size = cljs.core.first(arglist__34234);
var p__34226 = cljs.core.rest(arglist__34234);
return G__34232__delegate(size,p__34226);
});
G__34232.cljs$core$IFn$_invoke$arity$variadic = G__34232__delegate;
return G__34232;
})()
;})(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__34235__delegate = function (size,_){
var bf = (new ArrayBuffer(size));
return (new DataView(bf));
};
var G__34235 = function (size,var_args){
var _ = null;
if (arguments.length > 1) {
var G__34236__i = 0, G__34236__a = new Array(arguments.length -  1);
while (G__34236__i < G__34236__a.length) {G__34236__a[G__34236__i] = arguments[G__34236__i + 1]; ++G__34236__i;}
  _ = new cljs.core.IndexedSeq(G__34236__a,0,null);
} 
return G__34235__delegate.call(this,size,_);};
G__34235.cljs$lang$maxFixedArity = 1;
G__34235.cljs$lang$applyTo = (function (arglist__34237){
var size = cljs.core.first(arglist__34237);
var _ = cljs.core.rest(arglist__34237);
return G__34235__delegate(size,_);
});
G__34235.cljs$core$IFn$_invoke$arity$variadic = G__34235__delegate;
return G__34235;
})()
);
