reddit_place/public/static/js/place/api.js
/**
       * Handle a single "chunk" or response data.
       * This modifies the local timestamp, canvas, and offset variables.
       * @function
       * @param {Uint8Array} responseArray
       */
Handle a single "chunk" or response data.
This modifies the local timestamp, canvas, and offset variables.
@function
@param {Uint8Array} responseArray
Handle a single " chunk " or response data . This modifies the local timestamp canvas and offset variables . @function @param { Uint8Array } responseArray
function handleChunk(responseArray) {
        if (!timestamp) {
          timestamp = (new Uint32Array(responseArray.buffer, 0, 1))[0],
          responseArray = new Uint8Array(responseArray.buffer, 4);
        }
        for (var i = 0; i < responseArray.byteLength; i++) {
          canvas[offset + 2 * i] = responseArray[i] >> 4;
          canvas[offset + 2 * i + 1] = responseArray[i] & 15;
        }
        offset += responseArray.byteLength * 2;
      }
function handleChunk ( responseArray ) { if ( ! timestamp ) { timestamp = ( new Uint32Array ( responseArray . buffer , 0 , 1 ) ) [ 0 ] , responseArray = new Uint8Array ( responseArray . buffer , 4 ) ; } for ( var i = 0 ; i < responseArray . byteLength ; i ++ ) { canvas [ offset + 2 * i ] = responseArray [ i ] >> 4 ; canvas [ offset + 2 * i + 1 ] = responseArray [ i ] & 15 ; } offset += responseArray . byteLength * 2 ; }
Handle a single "chunk" or response data.
Handle a single " chunk " or response data .
// If we haven't set the timestamp yet, slice it off of this chunk // Each byte in the responseArray represents two values in the canvas