// 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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.read_short[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos);
} else {
var m__23867__auto____$1 = (octet.buffer.read_short["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.write_short[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos,value);
} else {
var m__23867__auto____$1 = (octet.buffer.write_short["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.read_ushort[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos);
} else {
var m__23867__auto____$1 = (octet.buffer.read_ushort["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.write_ushort[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos,value);
} else {
var m__23867__auto____$1 = (octet.buffer.write_ushort["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.read_int[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos);
} else {
var m__23867__auto____$1 = (octet.buffer.read_int["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.write_int[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos,value);
} else {
var m__23867__auto____$1 = (octet.buffer.write_int["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.read_uint[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos);
} else {
var m__23867__auto____$1 = (octet.buffer.read_uint["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.write_uint[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos,value);
} else {
var m__23867__auto____$1 = (octet.buffer.write_uint["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.read_long[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos);
} else {
var m__23867__auto____$1 = (octet.buffer.read_long["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.write_long[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos,value);
} else {
var m__23867__auto____$1 = (octet.buffer.write_long["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.read_ulong[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos);
} else {
var m__23867__auto____$1 = (octet.buffer.read_ulong["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.write_ulong[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos,value);
} else {
var m__23867__auto____$1 = (octet.buffer.write_ulong["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.read_float[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos);
} else {
var m__23867__auto____$1 = (octet.buffer.read_float["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.write_float[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos,value);
} else {
var m__23867__auto____$1 = (octet.buffer.write_float["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.read_double[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos);
} else {
var m__23867__auto____$1 = (octet.buffer.read_double["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.write_double[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos,value);
} else {
var m__23867__auto____$1 = (octet.buffer.write_double["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.read_byte[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos);
} else {
var m__23867__auto____$1 = (octet.buffer.read_byte["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.write_byte[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos,value);
} else {
var m__23867__auto____$1 = (octet.buffer.write_byte["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.read_ubyte[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos);
} else {
var m__23867__auto____$1 = (octet.buffer.read_ubyte["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.write_ubyte[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos,value);
} else {
var m__23867__auto____$1 = (octet.buffer.write_ubyte["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.read_bytes[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos,size);
} else {
var m__23867__auto____$1 = (octet.buffer.read_bytes["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.write_bytes[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_,pos,size,data);
} else {
var m__23867__auto____$1 = (octet.buffer.write_bytes["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__23866__auto__ = (((_ == null))?null:_);
var m__23867__auto__ = (octet.buffer.get_capacity[goog.typeOf(x__23866__auto__)]);
if(!((m__23867__auto__ == null))){
return m__23867__auto__.call(null,_);
} else {
var m__23867__auto____$1 = (octet.buffer.get_capacity["_"]);
if(!((m__23867__auto____$1 == null))){
return m__23867__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__34203_SHARP_){
if(!((p1__34203_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34203_SHARP_.octet$buffer$IBufferShort$))){
return true;
} else {
if((!p1__34203_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34203_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34203_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34203#] (satisfies? IBufferShort p1__34203#)) 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__34204_SHARP_){
if(!((p1__34204_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34204_SHARP_.octet$buffer$IBufferShort$))){
return true;
} else {
if((!p1__34204_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34204_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34204_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34204#] (satisfies? IBufferShort p1__34204#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34205_SHARP_,p2__34206_SHARP_){
return octet.buffer.write_short.call(null,p1__34205_SHARP_,p2__34206_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__34207_SHARP_){
if(!((p1__34207_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34207_SHARP_.octet$buffer$IBufferShort$))){
return true;
} else {
if((!p1__34207_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34207_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34207_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34207#] (satisfies? IBufferShort p1__34207#)) 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__34208_SHARP_){
if(!((p1__34208_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34208_SHARP_.octet$buffer$IBufferShort$))){
return true;
} else {
if((!p1__34208_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34208_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34208_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34208#] (satisfies? IBufferShort p1__34208#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34209_SHARP_,p2__34210_SHARP_){
return octet.buffer.write_ushort.call(null,p1__34209_SHARP_,p2__34210_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__34211_SHARP_){
if(!((p1__34211_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34211_SHARP_.octet$buffer$IBufferInt$))){
return true;
} else {
if((!p1__34211_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34211_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34211_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34211#] (satisfies? IBufferInt p1__34211#)) 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__34212_SHARP_){
if(!((p1__34212_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34212_SHARP_.octet$buffer$IBufferInt$))){
return true;
} else {
if((!p1__34212_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34212_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34212_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34212#] (satisfies? IBufferInt p1__34212#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34213_SHARP_,p2__34214_SHARP_){
return octet.buffer.write_int.call(null,p1__34213_SHARP_,p2__34214_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__34215_SHARP_){
if(!((p1__34215_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34215_SHARP_.octet$buffer$IBufferInt$))){
return true;
} else {
if((!p1__34215_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34215_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34215_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34215#] (satisfies? IBufferInt p1__34215#)) 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__34216_SHARP_){
if(!((p1__34216_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34216_SHARP_.octet$buffer$IBufferInt$))){
return true;
} else {
if((!p1__34216_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34216_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34216_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34216#] (satisfies? IBufferInt p1__34216#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34217_SHARP_,p2__34218_SHARP_){
return octet.buffer.write_uint.call(null,p1__34217_SHARP_,p2__34218_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__34219_SHARP_){
if(!((p1__34219_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34219_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34219_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34219_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34219_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34219#] (satisfies? IBufferLong p1__34219#)) 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__34220_SHARP_){
if(!((p1__34220_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34220_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34220_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34220_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34220_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34220#] (satisfies? IBufferLong p1__34220#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34221_SHARP_,p2__34222_SHARP_){
return octet.buffer.write_long.call(null,p1__34221_SHARP_,p2__34222_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__34223_SHARP_){
if(!((p1__34223_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34223_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34223_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34223_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34223_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34223#] (satisfies? IBufferLong p1__34223#)) 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__34224_SHARP_){
if(!((p1__34224_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34224_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34224_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34224_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34224_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34224#] (satisfies? IBufferLong p1__34224#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34225_SHARP_,p2__34226_SHARP_){
return octet.buffer.write_ulong.call(null,p1__34225_SHARP_,p2__34226_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__34227_SHARP_){
if(!((p1__34227_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34227_SHARP_.octet$buffer$IBufferFloat$))){
return true;
} else {
if((!p1__34227_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferFloat,p1__34227_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferFloat,p1__34227_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34227#] (satisfies? IBufferFloat p1__34227#)) 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__34228_SHARP_){
if(!((p1__34228_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34228_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34228_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34228_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34228_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34228#] (satisfies? IBufferLong p1__34228#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34229_SHARP_,p2__34230_SHARP_){
return octet.buffer.write_float.call(null,p1__34229_SHARP_,p2__34230_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__34231_SHARP_){
if(!((p1__34231_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34231_SHARP_.octet$buffer$IBufferDouble$))){
return true;
} else {
if((!p1__34231_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__34231_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__34231_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34231#] (satisfies? IBufferDouble p1__34231#)) 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__34232_SHARP_){
if(!((p1__34232_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34232_SHARP_.octet$buffer$IBufferDouble$))){
return true;
} else {
if((!p1__34232_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__34232_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__34232_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34232#] (satisfies? IBufferDouble p1__34232#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34233_SHARP_,p2__34234_SHARP_){
return octet.buffer.write_double.call(null,p1__34233_SHARP_,p2__34234_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__34235_SHARP_){
if(!((p1__34235_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34235_SHARP_.octet$buffer$IBufferByte$))){
return true;
} else {
if((!p1__34235_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34235_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34235_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34235#] (satisfies? IBufferByte p1__34235#)) 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__34236_SHARP_){
if(!((p1__34236_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34236_SHARP_.octet$buffer$IBufferByte$))){
return true;
} else {
if((!p1__34236_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34236_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34236_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34236#] (satisfies? IBufferByte p1__34236#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34237_SHARP_,p2__34238_SHARP_){
return octet.buffer.write_byte.call(null,p1__34237_SHARP_,p2__34238_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__34239_SHARP_){
if(!((p1__34239_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34239_SHARP_.octet$buffer$IBufferByte$))){
return true;
} else {
if((!p1__34239_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34239_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34239_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34239#] (satisfies? IBufferByte p1__34239#)) 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__34240_SHARP_){
if(!((p1__34240_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34240_SHARP_.octet$buffer$IBufferByte$))){
return true;
} else {
if((!p1__34240_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34240_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34240_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34240#] (satisfies? IBufferByte p1__34240#)) buff)"));
}

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

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

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34247_SHARP_,p2__34248_SHARP_){
return octet.buffer.write_bytes.call(null,p1__34247_SHARP_,p2__34248_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__34249_SHARP_,p2__34250_SHARP_){
return (p1__34249_SHARP_ + octet.buffer.get_capacity.call(null,p2__34250_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__34273 = cljs.core.seq.call(null,cljs.core.range.call(null,data.length));
var chunk__34274 = null;
var count__34275 = (0);
var i__34276 = (0);
while(true){
if((i__34276 < count__34275)){
var i = cljs.core._nth.call(null,chunk__34274,i__34276);
buff__$1.setInt8((pos + i),(data[i]));

var G__34277 = seq__34273;
var G__34278 = chunk__34274;
var G__34279 = count__34275;
var G__34280 = (i__34276 + (1));
seq__34273 = G__34277;
chunk__34274 = G__34278;
count__34275 = G__34279;
i__34276 = G__34280;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__34273);
if(temp__5278__auto__){
var seq__34273__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__34273__$1)){
var c__24059__auto__ = cljs.core.chunk_first.call(null,seq__34273__$1);
var G__34281 = cljs.core.chunk_rest.call(null,seq__34273__$1);
var G__34282 = c__24059__auto__;
var G__34283 = cljs.core.count.call(null,c__24059__auto__);
var G__34284 = (0);
seq__34273 = G__34281;
chunk__34274 = G__34282;
count__34275 = G__34283;
i__34276 = G__34284;
continue;
} else {
var i = cljs.core.first.call(null,seq__34273__$1);
buff__$1.setInt8((pos + i),(data[i]));

var G__34285 = cljs.core.next.call(null,seq__34273__$1);
var G__34286 = null;
var G__34287 = (0);
var G__34288 = (0);
seq__34273 = G__34285;
chunk__34274 = G__34286;
count__34275 = G__34287;
i__34276 = G__34288;
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__24179__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__24180__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__24181__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__24182__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__24183__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__24179__auto__,prefer_table__24180__auto__,method_cache__24181__auto__,cached_hierarchy__24182__auto__,hierarchy__24183__auto__){
return (function() { 
var G__34295__delegate = function (size,p__34289){
var vec__34290 = p__34289;
var map__34293 = cljs.core.nth.call(null,vec__34290,(0),null);
var map__34293__$1 = ((((!((map__34293 == null)))?((((map__34293.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__34293.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__34293):map__34293);
var type = cljs.core.get.call(null,map__34293__$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__34293__$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__34295 = function (size,var_args){
var p__34289 = null;
if (arguments.length > 1) {
var G__34296__i = 0, G__34296__a = new Array(arguments.length -  1);
while (G__34296__i < G__34296__a.length) {G__34296__a[G__34296__i] = arguments[G__34296__i + 1]; ++G__34296__i;}
  p__34289 = new cljs.core.IndexedSeq(G__34296__a,0,null);
} 
return G__34295__delegate.call(this,size,p__34289);};
G__34295.cljs$lang$maxFixedArity = 1;
G__34295.cljs$lang$applyTo = (function (arglist__34297){
var size = cljs.core.first(arglist__34297);
var p__34289 = cljs.core.rest(arglist__34297);
return G__34295__delegate(size,p__34289);
});
G__34295.cljs$core$IFn$_invoke$arity$variadic = G__34295__delegate;
return G__34295;
})()
;})(method_table__24179__auto__,prefer_table__24180__auto__,method_cache__24181__auto__,cached_hierarchy__24182__auto__,hierarchy__24183__auto__))
,new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__24183__auto__,method_table__24179__auto__,prefer_table__24180__auto__,method_cache__24181__auto__,cached_hierarchy__24182__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__34298__delegate = function (size,_){
var bf = (new ArrayBuffer(size));
return (new DataView(bf));
};
var G__34298 = function (size,var_args){
var _ = null;
if (arguments.length > 1) {
var G__34299__i = 0, G__34299__a = new Array(arguments.length -  1);
while (G__34299__i < G__34299__a.length) {G__34299__a[G__34299__i] = arguments[G__34299__i + 1]; ++G__34299__i;}
  _ = new cljs.core.IndexedSeq(G__34299__a,0,null);
} 
return G__34298__delegate.call(this,size,_);};
G__34298.cljs$lang$maxFixedArity = 1;
G__34298.cljs$lang$applyTo = (function (arglist__34300){
var size = cljs.core.first(arglist__34300);
var _ = cljs.core.rest(arglist__34300);
return G__34298__delegate(size,_);
});
G__34298.cljs$core$IFn$_invoke$arity$variadic = G__34298__delegate;
return G__34298;
})()
);
