deserialize(outputArray, errOutputArray) {

        const _ = this;
        let pos = 0;
        let totalParsed = 0;

        _._sizeBuffer && _._sizeBuffer.add(_._dataLen);

        while (deserializer.validate(_._buffer, pos, _._dataLen)) {

            const messageSize = deserializer.readSize(_._buffer, pos);
            const result = deserializer.deserialize(_._buffer, pos, _._limits, errOutputArray);
            if (result === undefined) {
                _._dataLen = 0;
                _._chunkTimesMsArr.length = 0;
                return undefined;
            }

            const startTimeMs = _._chunkTimesMsArr[0/*addTimeMs*/] || Date.now();

            if (result && typeof result === 'object')
                result._bufferTimeMs = Date.now() - startTimeMs;

            outputArray.push(result);
            pos += messageSize;
            _._dataLen -= messageSize;
            totalParsed++;

            if (_._dataLen > 0) {
                let timeDiscardLen = 0;
                while (_._chunkTimesMsArr[1/*bufferEnd*/] <= pos && timeDiscardLen < _._chunkTimesMsArr.length) {
                    timeDiscardLen += 2;
                }

                if (timeDiscardLen)
                    _._chunkTimesMsArr.splice(0, timeDiscardLen);
            }
        }

        // move incomplete data to beginning of buffer
        if (_._dataLen > 0) {
            copyBuffer = BosDeserializeBuffer._ensureBufferSize(copyBuffer, _._dataLen, _._maxLength);
            _._buffer.copy(copyBuffer, 0, pos, pos + _._dataLen);
            copyBuffer.copy(_._buffer, 0, 0, _._dataLen);
        }
        else {
            _._chunkTimesMsArr.length = 0;
        }

        return totalParsed;
    }
/**
     * Read data in buffer and deserialize any complete objects into an output array.
     * Deserialized object data is removed from the buffer.
     *
     * @param outputArray    {Array}    Array to push deserialized data into.
     * @param errOutputArray {string[]} An array to push error messages to.
     *
     * @returns {number|undefined} The number of deserialized objects added to the output array or undefined
     * if there is an error.
     */
Read data in buffer and deserialize any complete objects into an output array.
Deserialized object data is removed from the buffer.

@param outputArray    {Array}    Array to push deserialized data into.
@param errOutputArray {string[]} An array to push error messages to.

@returns {number|undefined} The number of deserialized objects added to the output array or undefined
if there is an error.
Read data in buffer and deserialize any complete objects into an output array . Deserialized object data is removed from the buffer . @param outputArray { Array } Array to push deserialized data into . @param errOutputArray { string [] } An array to push error messages to . @returns { number|undefined } The number of deserialized objects added to the output array or undefined if there is an error .
deserialize(outputArray, errOutputArray) {
        const _ = this;
        let pos = 0;
        let totalParsed = 0;
        _._sizeBuffer && _._sizeBuffer.add(_._dataLen);
        while (deserializer.validate(_._buffer, pos, _._dataLen)) {
            const messageSize = deserializer.readSize(_._buffer, pos);
            const result = deserializer.deserialize(_._buffer, pos, _._limits, errOutputArray);
            if (result === undefined) {
                _._dataLen = 0;
                _._chunkTimesMsArr.length = 0;
                return undefined;
            }
            const startTimeMs = _._chunkTimesMsArr[0] || Date.now();
            if (result && typeof result === 'object')
                result._bufferTimeMs = Date.now() - startTimeMs;
            outputArray.push(result);
            pos += messageSize;
            _._dataLen -= messageSize;
            totalParsed++;
            if (_._dataLen > 0) {
                let timeDiscardLen = 0;
                while (_._chunkTimesMsArr[1] <= pos && timeDiscardLen < _._chunkTimesMsArr.length) {
                    timeDiscardLen += 2;
                }
                if (timeDiscardLen)
                    _._chunkTimesMsArr.splice(0, timeDiscardLen);
            }
        }
        if (_._dataLen > 0) {
            copyBuffer = BosDeserializeBuffer._ensureBufferSize(copyBuffer, _._dataLen, _._maxLength);
            _._buffer.copy(copyBuffer, 0, pos, pos + _._dataLen);
            copyBuffer.copy(_._buffer, 0, 0, _._dataLen);
        }
        else {
            _._chunkTimesMsArr.length = 0;
        }
        return totalParsed;
    }
deserialize ( outputArray , errOutputArray ) { const _ = this ; let pos = 0 ; let totalParsed = 0 ; _ . _sizeBuffer && _ . _sizeBuffer . add ( _ . _dataLen ) ; while ( deserializer . validate ( _ . _buffer , pos , _ . _dataLen ) ) { const messageSize = deserializer . readSize ( _ . _buffer , pos ) ; const result = deserializer . deserialize ( _ . _buffer , pos , _ . _limits , errOutputArray ) ; if ( result === undefined ) { _ . _dataLen = 0 ; _ . _chunkTimesMsArr . length = 0 ; return undefined ; } const startTimeMs = _ . _chunkTimesMsArr [ 0 ] || Date . now ( ) ; if ( result && typeof result === 'object' ) result . _bufferTimeMs = Date . now ( ) - startTimeMs ; outputArray . push ( result ) ; pos += messageSize ; _ . _dataLen -= messageSize ; totalParsed ++ ; if ( _ . _dataLen > 0 ) { let timeDiscardLen = 0 ; while ( _ . _chunkTimesMsArr [ 1 ] <= pos && timeDiscardLen < _ . _chunkTimesMsArr . length ) { timeDiscardLen += 2 ; } if ( timeDiscardLen ) _ . _chunkTimesMsArr . splice ( 0 , timeDiscardLen ) ; } } if ( _ . _dataLen > 0 ) { copyBuffer = BosDeserializeBuffer . _ensureBufferSize ( copyBuffer , _ . _dataLen , _ . _maxLength ) ; _ . _buffer . copy ( copyBuffer , 0 , pos , pos + _ . _dataLen ) ; copyBuffer . copy ( _ . _buffer , 0 , 0 , _ . _dataLen ) ; } else { _ . _chunkTimesMsArr . length = 0 ; } return totalParsed ; }
Read data in buffer and deserialize any complete objects into an output array.
Read data in buffer and deserialize any complete objects into an output array .
/*addTimeMs*/ /*bufferEnd*/ // move incomplete data to beginning of buffer