lib/connection/result/chunk.js
function Chunk(options)
{
  // make sure the options object contains all the necessary information
  Errors.assertInternal(Util.isObject(options));
  Errors.assertInternal(Util.isObject(options.statement));
  Errors.assertInternal(Util.isObject(options.services));
  Errors.assertInternal(Util.isNumber(options.startIndex));
  Errors.assertInternal(Util.isArray(options.columns));
  Errors.assertInternal(Util.isObject(options.mapColumnNameToIndices));
  Errors.assertInternal(Util.isObject(options.statementParameters));
  Errors.assertInternal(Util.isString(options.resultVersion));
  Errors.assertInternal(Util.isNumber(options.rowCount));

  // if the result is small (i.e. not persisted on S3/Blob), there's no
  // compressed and uncompressed size, so default to -1
  this._compressedSize   = options.compressedSize   || -1;
  this._uncompressedSize = options.uncompressedSize || -1;

  // copy out other information from the options object and save it
  this._statement              = options.statement;
  this._services               = options.services;
  this._startIndex             = options.startIndex;
  this._url                    = options.url;
  this._columns                = options.columns;
  this._mapColumnNameToIndices = options.mapColumnNameToIndices;
  this._chunkHeaders           = options.chunkHeaders;
  this._rowset                 = options.rowset;

  // use the start index and row count to compute the end index
  this._endIndex = this._startIndex + options.rowCount - 1;

  // use the start and end index to build an id for this chunk
  this._id = buildId(this._startIndex, this._endIndex);
}
function Chunk(options)
{
  // make sure the options object contains all the necessary information
  Errors.assertInternal(Util.isObject(options));
  Errors.assertInternal(Util.isObject(options.statement));
  Errors.assertInternal(Util.isObject(options.services));
  Errors.assertInternal(Util.isNumber(options.startIndex));
  Errors.assertInternal(Util.isArray(options.columns));
  Errors.assertInternal(Util.isObject(options.mapColumnNameToIndices));
  Errors.assertInternal(Util.isObject(options.statementParameters));
  Errors.assertInternal(Util.isString(options.resultVersion));
  Errors.assertInternal(Util.isNumber(options.rowCount));

  // if the result is small (i.e. not persisted on S3/Blob), there's no
  // compressed and uncompressed size, so default to -1
  this._compressedSize   = options.compressedSize   || -1;
  this._uncompressedSize = options.uncompressedSize || -1;

  // copy out other information from the options object and save it
  this._statement              = options.statement;
  this._services               = options.services;
  this._startIndex             = options.startIndex;
  this._url                    = options.url;
  this._columns                = options.columns;
  this._mapColumnNameToIndices = options.mapColumnNameToIndices;
  this._chunkHeaders           = options.chunkHeaders;
  this._rowset                 = options.rowset;

  // use the start index and row count to compute the end index
  this._endIndex = this._startIndex + options.rowCount - 1;

  // use the start and end index to build an id for this chunk
  this._id = buildId(this._startIndex, this._endIndex);
}
function Chunk ( options ) { // make sure the options object contains all the necessary information Errors . assertInternal ( Util . isObject ( options ) ) ; Errors . assertInternal ( Util . isObject ( options . statement ) ) ; Errors . assertInternal ( Util . isObject ( options . services ) ) ; Errors . assertInternal ( Util . isNumber ( options . startIndex ) ) ; Errors . assertInternal ( Util . isArray ( options . columns ) ) ; Errors . assertInternal ( Util . isObject ( options . mapColumnNameToIndices ) ) ; Errors . assertInternal ( Util . isObject ( options . statementParameters ) ) ; Errors . assertInternal ( Util . isString ( options . resultVersion ) ) ; Errors . assertInternal ( Util . isNumber ( options . rowCount ) ) ; // if the result is small (i.e. not persisted on S3/Blob), there's no // compressed and uncompressed size, so default to -1 this . _compressedSize = options . compressedSize || - 1 ; this . _uncompressedSize = options . uncompressedSize || - 1 ; // copy out other information from the options object and save it this . _statement = options . statement ; this . _services = options . services ; this . _startIndex = options . startIndex ; this . _url = options . url ; this . _columns = options . columns ; this . _mapColumnNameToIndices = options . mapColumnNameToIndices ; this . _chunkHeaders = options . chunkHeaders ; this . _rowset = options . rowset ; // use the start index and row count to compute the end index this . _endIndex = this . _startIndex + options . rowCount - 1 ; // use the start and end index to build an id for this chunk this . _id = buildId ( this . _startIndex , this . _endIndex ) ; }
Creates a new Chunk.

@param options
@constructor
Creates a new Chunk .