|
@@ -2939,69 +2939,4 @@ var util = {
|
|
|
|
|
|
module.exports = util;
|
|
module.exports = util;
|
|
|
|
|
|
-},{"js-binarypack":14}],14:[function(require,module,exports){
|
|
|
|
-arguments[4][10][0].apply(exports,arguments)
|
|
|
|
-},{"./bufferbuilder":15,"C:\\node\\peerjs\\node_modules\\js-binarypack\\lib\\binarypack.js":10}],15:[function(require,module,exports){
|
|
|
|
-var binaryFeatures = {};
|
|
|
|
-binaryFeatures.useBlobBuilder = (function(){
|
|
|
|
- try {
|
|
|
|
- new Blob([]);
|
|
|
|
- return false;
|
|
|
|
- } catch (e) {
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
-})();
|
|
|
|
-
|
|
|
|
-binaryFeatures.useArrayBufferView = !binaryFeatures.useBlobBuilder && (function(){
|
|
|
|
- try {
|
|
|
|
- return (new Blob([new Uint8Array([])])).size === 0;
|
|
|
|
- } catch (e) {
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
-})();
|
|
|
|
-
|
|
|
|
-module.exports.binaryFeatures = binaryFeatures;
|
|
|
|
-var BlobBuilder = module.exports.BlobBuilder = window.WebKitBlobBuilder ||
|
|
|
|
- window.MozBlobBuilder || window.MSBlobBuilder || window.BlobBuilder;
|
|
|
|
-
|
|
|
|
-function BufferBuilder(){
|
|
|
|
- this._pieces = [];
|
|
|
|
- this._parts = [];
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-BufferBuilder.prototype.append = function(data) {
|
|
|
|
- if(typeof data === 'number') {
|
|
|
|
- this._pieces.push(data);
|
|
|
|
- } else {
|
|
|
|
- this.flush();
|
|
|
|
- this._parts.push(data);
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-BufferBuilder.prototype.flush = function() {
|
|
|
|
- if (this._pieces.length > 0) {
|
|
|
|
- var buf = new Uint8Array(this._pieces);
|
|
|
|
- if(!binaryFeatures.useArrayBufferView) {
|
|
|
|
- buf = buf.buffer;
|
|
|
|
- }
|
|
|
|
- this._parts.push(buf);
|
|
|
|
- this._pieces = [];
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-BufferBuilder.prototype.getBuffer = function() {
|
|
|
|
- this.flush();
|
|
|
|
- if(binaryFeatures.useBlobBuilder) {
|
|
|
|
- var builder = new BlobBuilder();
|
|
|
|
- for(var i = 0, ii = this._parts.length; i < ii; i++) {
|
|
|
|
- builder.append(this._parts[i]);
|
|
|
|
- }
|
|
|
|
- return builder.getBlob();
|
|
|
|
- } else {
|
|
|
|
- return new Blob(this._parts);
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-module.exports.BufferBuilder = BufferBuilder;
|
|
|
|
-
|
|
|
|
-},{}]},{},[3]);
|
|
|
|
|
|
+},{"js-binarypack":10}]},{},[3]);
|