1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-07-07 10:40:49 +00:00
Files
musix-oss/node_modules/bytebuffer/src/wrap-node.js
MatteZ02 30022c7634 Modules
2020-03-03 22:30:50 +02:00

51 lines
1.7 KiB
JavaScript

/*
Copyright 2013-2014 Daniel Wirtz <dcode@dcode.io>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
//? NODE = true;
/**
* @license bytebuffer.js (c) 2015 Daniel Wirtz <dcode@dcode.io>
* Backing buffer / Accessor: node Buffer
* Released under the Apache License, Version 2.0
* see: https://github.com/dcodeIO/bytebuffer.js for details
*/
module.exports = (function() {
"use strict";
var buffer = require("buffer"),
Buffer = buffer["Buffer"],
Long = require("long"),
memcpy = null; try { memcpy = require("memcpy"); } catch (e) {}
//? include("ByteBuffer.js");
/**
* node-memcpy. This is an optional binding dependency and may not be present.
* @function
* @param {!(Buffer|ArrayBuffer|Uint8Array)} target Destination
* @param {number|!(Buffer|ArrayBuffer)} targetStart Destination start, defaults to 0.
* @param {(!(Buffer|ArrayBuffer|Uint8Array)|number)=} source Source
* @param {number=} sourceStart Source start, defaults to 0.
* @param {number=} sourceEnd Source end, defaults to capacity.
* @returns {number} Number of bytes copied
* @throws {Error} If any index is out of bounds
* @expose
*/
ByteBuffer.memcpy = memcpy;
return ByteBuffer;
})();