MCPcopy Create free account
hub / github.com/microsoft/SandDance / blitBuffer

Function blitBuffer

docs/app/js/sanddance-app.js:114052–114058  ·  view source on GitHub ↗
(src, dst, offset, length)

Source from the content-addressed store, hash-verified

114050 return base64.toByteArray(base64clean(str));
114051}
114052function blitBuffer(src, dst, offset, length) {
114053 for(var i = 0; i < length; ++i){
114054 if (i + offset >= dst.length || i >= src.length) break;
114055 dst[i + offset] = src[i];
114056 }
114057 return i;
114058}
114059// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass
114060// the `instanceof` check but they should be treated as of that type.
114061// See: https://github.com/feross/buffer/issues/166

Callers 4

utf8WriteFunction · 0.70
asciiWriteFunction · 0.70
base64WriteFunction · 0.70
ucs2WriteFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected