lib/rt-utils.js
function fromBuffer(b) {
	// TODO: Use nodert-streams to more efficiently convert the buffer?
	let len = b.length;
	const DataWriter = Windows.Storage.Streams.DataWriter;
	let w = new DataWriter();
	for (let i = 0; i < len; i++) {
		w.writeByte(b[i]);
	}
	return w.detachBuffer();
}
function fromBuffer(b) {
	// TODO: Use nodert-streams to more efficiently convert the buffer?
	let len = b.length;
	const DataWriter = Windows.Storage.Streams.DataWriter;
	let w = new DataWriter();
	for (let i = 0; i < len; i++) {
		w.writeByte(b[i]);
	}
	return w.detachBuffer();
}
function fromBuffer ( b ) { // TODO: Use nodert-streams to more efficiently convert the buffer? let len = b . length ; const DataWriter = Windows . Storage . Streams . DataWriter ; let w = new DataWriter ( ) ; for ( let i = 0 ; i < len ; i ++ ) { w . writeByte ( b [ i ] ) ; } return w . detachBuffer ( ) ; }
Convert a JS Buffer to a WinRT IBuffer.
Convert a JS Buffer to a WinRT IBuffer .