lib/protocol/compressor.js
function cut(buffer, size) {
  var chunks = [];
  var cursor = 0;
  do {
    var chunkSize = Math.min(size, buffer.length - cursor);
    chunks.push(buffer.slice(cursor, cursor + chunkSize));
    cursor += chunkSize;
  } while(cursor < buffer.length);
  return chunks;
}
function cut(buffer, size) {
  var chunks = [];
  var cursor = 0;
  do {
    var chunkSize = Math.min(size, buffer.length - cursor);
    chunks.push(buffer.slice(cursor, cursor + chunkSize));
    cursor += chunkSize;
  } while(cursor < buffer.length);
  return chunks;
}
function cut ( buffer , size ) { var chunks = [ ] ; var cursor = 0 ; do { var chunkSize = Math . min ( size , buffer . length - cursor ) ; chunks . push ( buffer . slice ( cursor , cursor + chunkSize ) ) ; cursor += chunkSize ; } while ( cursor < buffer . length ) ; return chunks ; }
Cut `buffer` into chunks not larger than `size`
Cut buffer into chunks not larger than size