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

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34027_SHARP_,p2__34028_SHARP_){
return octet.buffer.write_short.call(null,p1__34027_SHARP_,p2__34028_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__34029_SHARP_){
if(!((p1__34029_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34029_SHARP_.octet$buffer$IBufferShort$))){
return true;
} else {
if((!p1__34029_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34029_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34029_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34029#] (satisfies? IBufferShort p1__34029#)) 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__34030_SHARP_){
if(!((p1__34030_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34030_SHARP_.octet$buffer$IBufferShort$))){
return true;
} else {
if((!p1__34030_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34030_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__34030_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34030#] (satisfies? IBufferShort p1__34030#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34031_SHARP_,p2__34032_SHARP_){
return octet.buffer.write_ushort.call(null,p1__34031_SHARP_,p2__34032_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__34033_SHARP_){
if(!((p1__34033_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34033_SHARP_.octet$buffer$IBufferInt$))){
return true;
} else {
if((!p1__34033_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34033_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34033_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34033#] (satisfies? IBufferInt p1__34033#)) 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__34034_SHARP_){
if(!((p1__34034_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34034_SHARP_.octet$buffer$IBufferInt$))){
return true;
} else {
if((!p1__34034_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34034_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34034_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34034#] (satisfies? IBufferInt p1__34034#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34035_SHARP_,p2__34036_SHARP_){
return octet.buffer.write_int.call(null,p1__34035_SHARP_,p2__34036_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__34037_SHARP_){
if(!((p1__34037_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34037_SHARP_.octet$buffer$IBufferInt$))){
return true;
} else {
if((!p1__34037_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34037_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34037_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34037#] (satisfies? IBufferInt p1__34037#)) 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__34038_SHARP_){
if(!((p1__34038_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34038_SHARP_.octet$buffer$IBufferInt$))){
return true;
} else {
if((!p1__34038_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34038_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__34038_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34038#] (satisfies? IBufferInt p1__34038#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34039_SHARP_,p2__34040_SHARP_){
return octet.buffer.write_uint.call(null,p1__34039_SHARP_,p2__34040_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__34041_SHARP_){
if(!((p1__34041_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34041_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34041_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34041_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34041_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34041#] (satisfies? IBufferLong p1__34041#)) 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__34042_SHARP_){
if(!((p1__34042_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34042_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34042_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34042_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34042_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34042#] (satisfies? IBufferLong p1__34042#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34043_SHARP_,p2__34044_SHARP_){
return octet.buffer.write_long.call(null,p1__34043_SHARP_,p2__34044_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__34045_SHARP_){
if(!((p1__34045_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34045_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34045_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34045_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34045_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34045#] (satisfies? IBufferLong p1__34045#)) 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__34046_SHARP_){
if(!((p1__34046_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34046_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34046_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34046_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34046_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34046#] (satisfies? IBufferLong p1__34046#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34047_SHARP_,p2__34048_SHARP_){
return octet.buffer.write_ulong.call(null,p1__34047_SHARP_,p2__34048_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__34049_SHARP_){
if(!((p1__34049_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34049_SHARP_.octet$buffer$IBufferFloat$))){
return true;
} else {
if((!p1__34049_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferFloat,p1__34049_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferFloat,p1__34049_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34049#] (satisfies? IBufferFloat p1__34049#)) 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__34050_SHARP_){
if(!((p1__34050_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34050_SHARP_.octet$buffer$IBufferLong$))){
return true;
} else {
if((!p1__34050_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34050_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__34050_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34050#] (satisfies? IBufferLong p1__34050#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34051_SHARP_,p2__34052_SHARP_){
return octet.buffer.write_float.call(null,p1__34051_SHARP_,p2__34052_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__34053_SHARP_){
if(!((p1__34053_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34053_SHARP_.octet$buffer$IBufferDouble$))){
return true;
} else {
if((!p1__34053_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__34053_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__34053_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34053#] (satisfies? IBufferDouble p1__34053#)) 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__34054_SHARP_){
if(!((p1__34054_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34054_SHARP_.octet$buffer$IBufferDouble$))){
return true;
} else {
if((!p1__34054_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__34054_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__34054_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34054#] (satisfies? IBufferDouble p1__34054#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34055_SHARP_,p2__34056_SHARP_){
return octet.buffer.write_double.call(null,p1__34055_SHARP_,p2__34056_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__34057_SHARP_){
if(!((p1__34057_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34057_SHARP_.octet$buffer$IBufferByte$))){
return true;
} else {
if((!p1__34057_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34057_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34057_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34057#] (satisfies? IBufferByte p1__34057#)) 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__34058_SHARP_){
if(!((p1__34058_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34058_SHARP_.octet$buffer$IBufferByte$))){
return true;
} else {
if((!p1__34058_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34058_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34058_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34058#] (satisfies? IBufferByte p1__34058#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34059_SHARP_,p2__34060_SHARP_){
return octet.buffer.write_byte.call(null,p1__34059_SHARP_,p2__34060_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__34061_SHARP_){
if(!((p1__34061_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34061_SHARP_.octet$buffer$IBufferByte$))){
return true;
} else {
if((!p1__34061_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34061_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34061_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34061#] (satisfies? IBufferByte p1__34061#)) 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__34062_SHARP_){
if(!((p1__34062_SHARP_ == null))){
if((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__34062_SHARP_.octet$buffer$IBufferByte$))){
return true;
} else {
if((!p1__34062_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34062_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__34062_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__34062#] (satisfies? IBufferByte p1__34062#)) buff)"));
}

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

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

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__34069_SHARP_,p2__34070_SHARP_){
return octet.buffer.write_bytes.call(null,p1__34069_SHARP_,p2__34070_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__34071_SHARP_,p2__34072_SHARP_){
return (p1__34071_SHARP_ + octet.buffer.get_capacity.call(null,p2__34072_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__34095 = cljs.core.seq.call(null,cljs.core.range.call(null,data.length));
var chunk__34096 = null;
var count__34097 = (0);
var i__34098 = (0);
while(true){
if((i__34098 < count__34097)){
var i = cljs.core._nth.call(null,chunk__34096,i__34098);
buff__$1.setInt8((pos + i),(data[i]));

var G__34099 = seq__34095;
var G__34100 = chunk__34096;
var G__34101 = count__34097;
var G__34102 = (i__34098 + (1));
seq__34095 = G__34099;
chunk__34096 = G__34100;
count__34097 = G__34101;
i__34098 = G__34102;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__34095);
if(temp__5278__auto__){
var seq__34095__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__34095__$1)){
var c__24249__auto__ = cljs.core.chunk_first.call(null,seq__34095__$1);
var G__34103 = cljs.core.chunk_rest.call(null,seq__34095__$1);
var G__34104 = c__24249__auto__;
var G__34105 = cljs.core.count.call(null,c__24249__auto__);
var G__34106 = (0);
seq__34095 = G__34103;
chunk__34096 = G__34104;
count__34097 = G__34105;
i__34098 = G__34106;
continue;
} else {
var i = cljs.core.first.call(null,seq__34095__$1);
buff__$1.setInt8((pos + i),(data[i]));

var G__34107 = cljs.core.next.call(null,seq__34095__$1);
var G__34108 = null;
var G__34109 = (0);
var G__34110 = (0);
seq__34095 = G__34107;
chunk__34096 = G__34108;
count__34097 = G__34109;
i__34098 = G__34110;
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__34117__delegate = function (size,p__34111){
var vec__34112 = p__34111;
var map__34115 = cljs.core.nth.call(null,vec__34112,(0),null);
var map__34115__$1 = ((((!((map__34115 == null)))?((((map__34115.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__34115.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__34115):map__34115);
var type = cljs.core.get.call(null,map__34115__$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__34115__$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__34117 = function (size,var_args){
var p__34111 = null;
if (arguments.length > 1) {
var G__34118__i = 0, G__34118__a = new Array(arguments.length -  1);
while (G__34118__i < G__34118__a.length) {G__34118__a[G__34118__i] = arguments[G__34118__i + 1]; ++G__34118__i;}
  p__34111 = new cljs.core.IndexedSeq(G__34118__a,0,null);
} 
return G__34117__delegate.call(this,size,p__34111);};
G__34117.cljs$lang$maxFixedArity = 1;
G__34117.cljs$lang$applyTo = (function (arglist__34119){
var size = cljs.core.first(arglist__34119);
var p__34111 = cljs.core.rest(arglist__34119);
return G__34117__delegate(size,p__34111);
});
G__34117.cljs$core$IFn$_invoke$arity$variadic = G__34117__delegate;
return G__34117;
})()
;})(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__34120__delegate = function (size,_){
var bf = (new ArrayBuffer(size));
return (new DataView(bf));
};
var G__34120 = function (size,var_args){
var _ = null;
if (arguments.length > 1) {
var G__34121__i = 0, G__34121__a = new Array(arguments.length -  1);
while (G__34121__i < G__34121__a.length) {G__34121__a[G__34121__i] = arguments[G__34121__i + 1]; ++G__34121__i;}
  _ = new cljs.core.IndexedSeq(G__34121__a,0,null);
} 
return G__34120__delegate.call(this,size,_);};
G__34120.cljs$lang$maxFixedArity = 1;
G__34120.cljs$lang$applyTo = (function (arglist__34122){
var size = cljs.core.first(arglist__34122);
var _ = cljs.core.rest(arglist__34122);
return G__34120__delegate(size,_);
});
G__34120.cljs$core$IFn$_invoke$arity$variadic = G__34120__delegate;
return G__34120;
})()
);
