MCPcopy Index your code
hub / github.com/SnapDrop/snapdrop / constructor

Method constructor

client/scripts/network.js:425–435  ·  view source on GitHub ↗
(file, onChunk, onPartitionEnd)

Source from the content-addressed store, hash-verified

423class FileChunker {
424
425 constructor(file, onChunk, onPartitionEnd) {
426 this._chunkSize = 64000; // 64 KB
427 this._maxPartitionSize = 1e6; // 1 MB
428 this._offset = 0;
429 this._partitionSize = 0;
430 this._file = file;
431 this._onChunk = onChunk;
432 this._onPartitionEnd = onPartitionEnd;
433 this._reader = new FileReader();
434 this._reader.addEventListener('load', e => this._onChunkRead(e.target.result));
435 }
436
437 nextPartition() {
438 this._partitionSize = 0;

Callers

nothing calls this directly

Calls 1

_onChunkReadMethod · 0.95

Tested by

no test coverage detected