MCPcopy Create free account
hub / github.com/mscdex/ssh2 / read

Method read

lib/protocol/SFTP.js:402–417  ·  view source on GitHub ↗
(handle, buf, off, len, position, cb)

Source from the content-addressed store, hash-verified

400 );
401 }
402 read(handle, buf, off, len, position, cb) {
403 if (this.server)
404 throw new Error('Client-only method called in server mode');
405 if (!Buffer.isBuffer(handle))
406 throw new Error('handle is not a Buffer');
407 if (!Buffer.isBuffer(buf))
408 throw new Error('buffer is not a Buffer');
409 if (off >= buf.length)
410 throw new Error('offset is out of bounds');
411 if (off + len > buf.length)
412 throw new Error('length extends beyond buffer');
413 if (position === null)
414 throw new Error('null position currently unsupported');
415
416 read_(this, handle, buf, off, len, position, cb);
417 }
418 readData(handle, buf, off, len, position, cb) {
419 // Backwards compatibility
420 this.read(handle, buf, off, len, position, cb);

Callers 6

readDataMethod · 0.95
onKEXPayloadFunction · 0.45
singleReadFunction · 0.45
SFTP.jsFile · 0.45
onPayloadFunction · 0.45
test-sftp.jsFile · 0.45

Calls 1

read_Function · 0.85

Tested by

no test coverage detected