// Compiled by ClojureScript 1.10.520 {}
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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.read_short[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos);
} else {
var m__4431__auto__ = (octet.buffer.read_short["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.write_short[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos,value);
} else {
var m__4431__auto__ = (octet.buffer.write_short["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.read_ushort[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos);
} else {
var m__4431__auto__ = (octet.buffer.read_ushort["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.write_ushort[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos,value);
} else {
var m__4431__auto__ = (octet.buffer.write_ushort["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.read_int[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos);
} else {
var m__4431__auto__ = (octet.buffer.read_int["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.write_int[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos,value);
} else {
var m__4431__auto__ = (octet.buffer.write_int["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.read_uint[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos);
} else {
var m__4431__auto__ = (octet.buffer.read_uint["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.write_uint[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos,value);
} else {
var m__4431__auto__ = (octet.buffer.write_uint["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.read_long[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos);
} else {
var m__4431__auto__ = (octet.buffer.read_long["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.write_long[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos,value);
} else {
var m__4431__auto__ = (octet.buffer.write_long["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.read_ulong[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos);
} else {
var m__4431__auto__ = (octet.buffer.read_ulong["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.write_ulong[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos,value);
} else {
var m__4431__auto__ = (octet.buffer.write_ulong["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.read_float[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos);
} else {
var m__4431__auto__ = (octet.buffer.read_float["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.write_float[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos,value);
} else {
var m__4431__auto__ = (octet.buffer.write_float["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.read_double[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos);
} else {
var m__4431__auto__ = (octet.buffer.read_double["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.write_double[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos,value);
} else {
var m__4431__auto__ = (octet.buffer.write_double["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.read_byte[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos);
} else {
var m__4431__auto__ = (octet.buffer.read_byte["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.write_byte[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos,value);
} else {
var m__4431__auto__ = (octet.buffer.write_byte["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.read_ubyte[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos);
} else {
var m__4431__auto__ = (octet.buffer.read_ubyte["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.write_ubyte[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos,value);
} else {
var m__4431__auto__ = (octet.buffer.write_ubyte["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.read_bytes[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos,size);
} else {
var m__4431__auto__ = (octet.buffer.read_bytes["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.write_bytes[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_,pos,size,data);
} else {
var m__4431__auto__ = (octet.buffer.write_bytes["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__4433__auto__ = (((_ == null))?null:_);
var m__4434__auto__ = (octet.buffer.get_capacity[goog.typeOf(x__4433__auto__)]);
if((!((m__4434__auto__ == null)))){
return m__4434__auto__.call(null,_);
} else {
var m__4431__auto__ = (octet.buffer.get_capacity["_"]);
if((!((m__4431__auto__ == null)))){
return m__4431__auto__.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__27240_SHARP_){
if((!((p1__27240_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27240_SHARP_.octet$buffer$IBufferShort$)))){
return true;
} else {
if((!p1__27240_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__27240_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__27240_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27240#] (satisfies? IBufferShort p1__27240#)) 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__27241_SHARP_){
if((!((p1__27241_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27241_SHARP_.octet$buffer$IBufferShort$)))){
return true;
} else {
if((!p1__27241_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__27241_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__27241_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27241#] (satisfies? IBufferShort p1__27241#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__27242_SHARP_,p2__27243_SHARP_){
return octet.buffer.write_short.call(null,p1__27242_SHARP_,p2__27243_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__27244_SHARP_){
if((!((p1__27244_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27244_SHARP_.octet$buffer$IBufferShort$)))){
return true;
} else {
if((!p1__27244_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__27244_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__27244_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27244#] (satisfies? IBufferShort p1__27244#)) 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__27245_SHARP_){
if((!((p1__27245_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27245_SHARP_.octet$buffer$IBufferShort$)))){
return true;
} else {
if((!p1__27245_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__27245_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferShort,p1__27245_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27245#] (satisfies? IBufferShort p1__27245#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__27246_SHARP_,p2__27247_SHARP_){
return octet.buffer.write_ushort.call(null,p1__27246_SHARP_,p2__27247_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__27248_SHARP_){
if((!((p1__27248_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27248_SHARP_.octet$buffer$IBufferInt$)))){
return true;
} else {
if((!p1__27248_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__27248_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__27248_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27248#] (satisfies? IBufferInt p1__27248#)) 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__27249_SHARP_){
if((!((p1__27249_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27249_SHARP_.octet$buffer$IBufferInt$)))){
return true;
} else {
if((!p1__27249_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__27249_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__27249_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27249#] (satisfies? IBufferInt p1__27249#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__27250_SHARP_,p2__27251_SHARP_){
return octet.buffer.write_int.call(null,p1__27250_SHARP_,p2__27251_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__27252_SHARP_){
if((!((p1__27252_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27252_SHARP_.octet$buffer$IBufferInt$)))){
return true;
} else {
if((!p1__27252_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__27252_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__27252_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27252#] (satisfies? IBufferInt p1__27252#)) 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__27253_SHARP_){
if((!((p1__27253_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27253_SHARP_.octet$buffer$IBufferInt$)))){
return true;
} else {
if((!p1__27253_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__27253_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferInt,p1__27253_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27253#] (satisfies? IBufferInt p1__27253#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__27254_SHARP_,p2__27255_SHARP_){
return octet.buffer.write_uint.call(null,p1__27254_SHARP_,p2__27255_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__27256_SHARP_){
if((!((p1__27256_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27256_SHARP_.octet$buffer$IBufferLong$)))){
return true;
} else {
if((!p1__27256_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__27256_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__27256_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27256#] (satisfies? IBufferLong p1__27256#)) 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__27257_SHARP_){
if((!((p1__27257_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27257_SHARP_.octet$buffer$IBufferLong$)))){
return true;
} else {
if((!p1__27257_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__27257_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__27257_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27257#] (satisfies? IBufferLong p1__27257#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__27258_SHARP_,p2__27259_SHARP_){
return octet.buffer.write_long.call(null,p1__27258_SHARP_,p2__27259_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__27260_SHARP_){
if((!((p1__27260_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27260_SHARP_.octet$buffer$IBufferLong$)))){
return true;
} else {
if((!p1__27260_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__27260_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__27260_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27260#] (satisfies? IBufferLong p1__27260#)) 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__27261_SHARP_){
if((!((p1__27261_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27261_SHARP_.octet$buffer$IBufferLong$)))){
return true;
} else {
if((!p1__27261_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__27261_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__27261_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27261#] (satisfies? IBufferLong p1__27261#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__27262_SHARP_,p2__27263_SHARP_){
return octet.buffer.write_ulong.call(null,p1__27262_SHARP_,p2__27263_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__27264_SHARP_){
if((!((p1__27264_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27264_SHARP_.octet$buffer$IBufferFloat$)))){
return true;
} else {
if((!p1__27264_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferFloat,p1__27264_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferFloat,p1__27264_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27264#] (satisfies? IBufferFloat p1__27264#)) 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__27265_SHARP_){
if((!((p1__27265_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27265_SHARP_.octet$buffer$IBufferLong$)))){
return true;
} else {
if((!p1__27265_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__27265_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferLong,p1__27265_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27265#] (satisfies? IBufferLong p1__27265#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__27266_SHARP_,p2__27267_SHARP_){
return octet.buffer.write_float.call(null,p1__27266_SHARP_,p2__27267_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__27268_SHARP_){
if((!((p1__27268_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27268_SHARP_.octet$buffer$IBufferDouble$)))){
return true;
} else {
if((!p1__27268_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__27268_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__27268_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27268#] (satisfies? IBufferDouble p1__27268#)) 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__27269_SHARP_){
if((!((p1__27269_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27269_SHARP_.octet$buffer$IBufferDouble$)))){
return true;
} else {
if((!p1__27269_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__27269_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferDouble,p1__27269_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27269#] (satisfies? IBufferDouble p1__27269#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__27270_SHARP_,p2__27271_SHARP_){
return octet.buffer.write_double.call(null,p1__27270_SHARP_,p2__27271_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__27272_SHARP_){
if((!((p1__27272_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27272_SHARP_.octet$buffer$IBufferByte$)))){
return true;
} else {
if((!p1__27272_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__27272_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__27272_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27272#] (satisfies? IBufferByte p1__27272#)) 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__27273_SHARP_){
if((!((p1__27273_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27273_SHARP_.octet$buffer$IBufferByte$)))){
return true;
} else {
if((!p1__27273_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__27273_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__27273_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27273#] (satisfies? IBufferByte p1__27273#)) buff)"));
}

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__27274_SHARP_,p2__27275_SHARP_){
return octet.buffer.write_byte.call(null,p1__27274_SHARP_,p2__27275_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__27276_SHARP_){
if((!((p1__27276_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27276_SHARP_.octet$buffer$IBufferByte$)))){
return true;
} else {
if((!p1__27276_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__27276_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__27276_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27276#] (satisfies? IBufferByte p1__27276#)) 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__27277_SHARP_){
if((!((p1__27277_SHARP_ == null)))){
if(((false) || ((cljs.core.PROTOCOL_SENTINEL === p1__27277_SHARP_.octet$buffer$IBufferByte$)))){
return true;
} else {
if((!p1__27277_SHARP_.cljs$lang$protocol_mask$partition$)){
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__27277_SHARP_);
} else {
return false;
}
}
} else {
return cljs.core.native_satisfies_QMARK_.call(null,octet.buffer.IBufferByte,p1__27277_SHARP_);
}
});})(buff__$1))
,buff__$1)){
} else {
throw (new Error("Assert failed: (every? (fn* [p1__27277#] (satisfies? IBufferByte p1__27277#)) buff)"));
}

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

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

return octet.buffer.stream_operation.call(null,((function (buff__$1){
return (function (p1__27284_SHARP_,p2__27285_SHARP_){
return octet.buffer.write_bytes.call(null,p1__27284_SHARP_,p2__27285_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__27286_SHARP_,p2__27287_SHARP_){
return (p1__27286_SHARP_ + octet.buffer.get_capacity.call(null,p2__27287_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__27310 = cljs.core.seq.call(null,cljs.core.range.call(null,data.length));
var chunk__27311 = null;
var count__27312 = (0);
var i__27313 = (0);
while(true){
if((i__27313 < count__27312)){
var i = cljs.core._nth.call(null,chunk__27311,i__27313);
buff__$1.setInt8((pos + i),(data[i]));


var G__27314 = seq__27310;
var G__27315 = chunk__27311;
var G__27316 = count__27312;
var G__27317 = (i__27313 + (1));
seq__27310 = G__27314;
chunk__27311 = G__27315;
count__27312 = G__27316;
i__27313 = G__27317;
continue;
} else {
var temp__5720__auto__ = cljs.core.seq.call(null,seq__27310);
if(temp__5720__auto__){
var seq__27310__$1 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__27310__$1)){
var c__4550__auto__ = cljs.core.chunk_first.call(null,seq__27310__$1);
var G__27318 = cljs.core.chunk_rest.call(null,seq__27310__$1);
var G__27319 = c__4550__auto__;
var G__27320 = cljs.core.count.call(null,c__4550__auto__);
var G__27321 = (0);
seq__27310 = G__27318;
chunk__27311 = G__27319;
count__27312 = G__27320;
i__27313 = G__27321;
continue;
} else {
var i = cljs.core.first.call(null,seq__27310__$1);
buff__$1.setInt8((pos + i),(data[i]));


var G__27322 = cljs.core.next.call(null,seq__27310__$1);
var G__27323 = null;
var G__27324 = (0);
var G__27325 = (0);
seq__27310 = G__27322;
chunk__27311 = G__27323;
count__27312 = G__27324;
i__27313 = G__27325;
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 !== 'undefined') && (typeof octet.buffer !== 'undefined') && (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__4613__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__4614__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__4615__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__4616__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__4617__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__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__,hierarchy__4617__auto__){
return (function() { 
var G__27332__delegate = function (size,p__27326){
var vec__27327 = p__27326;
var map__27330 = cljs.core.nth.call(null,vec__27327,(0),null);
var map__27330__$1 = (((((!((map__27330 == null))))?(((((map__27330.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__27330.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__27330):map__27330);
var type = cljs.core.get.call(null,map__27330__$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__27330__$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__27332 = function (size,var_args){
var p__27326 = null;
if (arguments.length > 1) {
var G__27333__i = 0, G__27333__a = new Array(arguments.length -  1);
while (G__27333__i < G__27333__a.length) {G__27333__a[G__27333__i] = arguments[G__27333__i + 1]; ++G__27333__i;}
  p__27326 = new cljs.core.IndexedSeq(G__27333__a,0,null);
} 
return G__27332__delegate.call(this,size,p__27326);};
G__27332.cljs$lang$maxFixedArity = 1;
G__27332.cljs$lang$applyTo = (function (arglist__27334){
var size = cljs.core.first(arglist__27334);
var p__27326 = cljs.core.rest(arglist__27334);
return G__27332__delegate(size,p__27326);
});
G__27332.cljs$core$IFn$_invoke$arity$variadic = G__27332__delegate;
return G__27332;
})()
;})(method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__auto__,hierarchy__4617__auto__))
,new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__4617__auto__,method_table__4613__auto__,prefer_table__4614__auto__,method_cache__4615__auto__,cached_hierarchy__4616__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__27335__delegate = function (size,_){
var bf = (new ArrayBuffer(size));
return (new DataView(bf));
};
var G__27335 = function (size,var_args){
var _ = null;
if (arguments.length > 1) {
var G__27336__i = 0, G__27336__a = new Array(arguments.length -  1);
while (G__27336__i < G__27336__a.length) {G__27336__a[G__27336__i] = arguments[G__27336__i + 1]; ++G__27336__i;}
  _ = new cljs.core.IndexedSeq(G__27336__a,0,null);
} 
return G__27335__delegate.call(this,size,_);};
G__27335.cljs$lang$maxFixedArity = 1;
G__27335.cljs$lang$applyTo = (function (arglist__27337){
var size = cljs.core.first(arglist__27337);
var _ = cljs.core.rest(arglist__27337);
return G__27335__delegate(size,_);
});
G__27335.cljs$core$IFn$_invoke$arity$variadic = G__27335__delegate;
return G__27335;
})()
);
