MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / onReadable

Method onReadable

modules/io/firmata/firmataserver.js:123–130  ·  view source on GitHub ↗
(count)

Source from the content-addressed store, hash-verified

121 this.transport.write(Uint8Array.of(value).buffer);
122 }
123 onReadable(count) {
124 let length = this.buffer.length;
125 let buffer = new Uint8Array(length + count);
126 buffer.set(this.buffer);
127 buffer.set(new Uint8Array(this.read(count)), length);
128 let position = this.onReceive(buffer, 0);
129 this.buffer = buffer.slice(position);
130 }
131 onReceive(bytes, position) {
132 while (position < bytes.length) {
133 const available = bytes.length - position;

Callers

nothing calls this directly

Calls 5

readMethod · 0.95
onReceiveMethod · 0.95
setMethod · 0.65
sliceMethod · 0.65
writeMethod · 0.65

Tested by

no test coverage detected