encoder.js
function encodeArray_PRIM_SHORT( encoder, data ) {

	//
	// Short Primitive Array (PRIM_SHORT)
	//
	// ........
	// 01111100
	//

	// Open log group
	encoder.counters.arr_prim_short+=1;
	encoder.log(LOG.ARR, "array.prim.short, len="+data.length+
		", peek="+data[0]+" [");
	encoder.logIndent(1);

	// Encode primitives one after the other
	encoder.stream8.write( pack1b( ARR_OP.PRIM_SHORT ) );
	encoder.stream8.write( pack1b( data.length, false ) );
	encoder.counters.arr_hdr+=2;

	// Encode each primitive individually
	for (var i=0, llen=data.length; i<llen; ++i) {
		encodePrimitive( encoder, data[i] );
	}

	// Close log group
	encoder.logIndent(-1);
	encoder.log(LOG.ARR, "]");

}
function encodeArray_PRIM_SHORT( encoder, data ) {

	//
	// Short Primitive Array (PRIM_SHORT)
	//
	// ........
	// 01111100
	//

	// Open log group
	encoder.counters.arr_prim_short+=1;
	encoder.log(LOG.ARR, "array.prim.short, len="+data.length+
		", peek="+data[0]+" [");
	encoder.logIndent(1);

	// Encode primitives one after the other
	encoder.stream8.write( pack1b( ARR_OP.PRIM_SHORT ) );
	encoder.stream8.write( pack1b( data.length, false ) );
	encoder.counters.arr_hdr+=2;

	// Encode each primitive individually
	for (var i=0, llen=data.length; i<llen; ++i) {
		encodePrimitive( encoder, data[i] );
	}

	// Close log group
	encoder.logIndent(-1);
	encoder.log(LOG.ARR, "]");

}
function encodeArray_PRIM_SHORT ( encoder , data ) { // // Short Primitive Array (PRIM_SHORT) // // ........ // 01111100 // // Open log group encoder . counters . arr_prim_short += 1 ; encoder . log ( LOG . ARR , "array.prim.short, len=" + data . length + ", peek=" + data [ 0 ] + " [" ) ; encoder . logIndent ( 1 ) ; // Encode primitives one after the other encoder . stream8 . write ( pack1b ( ARR_OP . PRIM_SHORT ) ) ; encoder . stream8 . write ( pack1b ( data . length , false ) ) ; encoder . counters . arr_hdr += 2 ; // Encode each primitive individually for ( var i = 0 , llen = data . length ; i < llen ; ++ i ) { encodePrimitive ( encoder , data [ i ] ) ; } // Close log group encoder . logIndent ( - 1 ) ; encoder . log ( LOG . ARR , "]" ) ; }
Encode array data as a short array of primitives
Encode array data as a short array of primitives