%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
// Flags: --expose-internals 'use strict'; const common = require('../common'); const assert = require('assert'); const { validateOffsetLengthRead, validateOffsetLengthWrite, } = require('internal/fs/utils'); { const offset = -1; assert.throws( () => validateOffsetLengthRead(offset, 0, 0), common.expectsError({ code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + `It must be >= 0. Received ${offset}` }) ); } { const length = -1; assert.throws( () => validateOffsetLengthRead(0, length, 0), common.expectsError({ code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "length" is out of range. ' + `It must be >= 0. Received ${length}` }) ); } { const offset = 1; const length = 1; const byteLength = offset + length - 1; assert.throws( () => validateOffsetLengthRead(offset, length, byteLength), common.expectsError({ code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "length" is out of range. ' + `It must be <= ${byteLength - offset}. Received ${length}` }) ); } // Most platforms don't allow reads or writes >= 2 GiB. // See https://github.com/libuv/libuv/pull/1501. const kIoMaxLength = 2 ** 31 - 1; // RangeError when offset > byteLength { const offset = 100; const length = 100; const byteLength = 50; assert.throws( () => validateOffsetLengthWrite(offset, length, byteLength), common.expectsError({ code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + `It must be <= ${byteLength}. Received ${offset}` }) ); } // RangeError when byteLength < kIoMaxLength, and length > byteLength - offset. { const offset = kIoMaxLength - 150; const length = 200; const byteLength = kIoMaxLength - 100; assert.throws( () => validateOffsetLengthWrite(offset, length, byteLength), common.expectsError({ code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "length" is out of range. ' + `It must be <= ${byteLength - offset}. Received ${length}` }) ); }