MCPcopy Create free account
hub / github.com/apache/cloudstack / _readData

Method _readData

systemvm/agent/noVNC/core/decoders/tight.js:357–385  ·  view source on GitHub ↗
(sock)

Source from the content-addressed store, hash-verified

355 }
356
357 _readData(sock) {
358 if (this._len === 0) {
359 if (sock.rQwait("TIGHT", 3)) {
360 return null;
361 }
362
363 let byte;
364
365 byte = sock.rQshift8();
366 this._len = byte & 0x7f;
367 if (byte & 0x80) {
368 byte = sock.rQshift8();
369 this._len |= (byte & 0x7f) << 7;
370 if (byte & 0x80) {
371 byte = sock.rQshift8();
372 this._len |= byte << 14;
373 }
374 }
375 }
376
377 if (sock.rQwait("TIGHT", this._len)) {
378 return null;
379 }
380
381 let data = sock.rQshiftBytes(this._len, false);
382 this._len = 0;
383
384 return data;
385 }
386
387 _getScratchBuffer(size) {
388 if (!this._scratchBuffer || (this._scratchBuffer.length < size)) {

Callers 5

_jpegRectMethod · 0.95
_copyFilterMethod · 0.95
_paletteFilterMethod · 0.95
_gradientFilterMethod · 0.95
_pngRectMethod · 0.80

Calls 3

rQwaitMethod · 0.80
rQshift8Method · 0.80
rQshiftBytesMethod · 0.80

Tested by

no test coverage detected