(buf, value, offset, littleEndian, noAssert)
| 48400 | } |
| 48401 | |
| 48402 | function _writeInt32 (buf, value, offset, littleEndian, noAssert) { |
| 48403 | if (!noAssert) { |
| 48404 | assert(value !== undefined && value !== null, 'missing value') |
| 48405 | assert(typeof littleEndian === 'boolean', 'missing or invalid endian') |
| 48406 | assert(offset !== undefined && offset !== null, 'missing offset') |
| 48407 | assert(offset + 3 < buf.length, 'Trying to write beyond buffer length') |
| 48408 | verifsint(value, 0x7fffffff, -0x80000000) |
| 48409 | } |
| 48410 | |
| 48411 | var len = buf.length |
| 48412 | if (offset >= len) |
| 48413 | return |
| 48414 | |
| 48415 | if (value >= 0) |
| 48416 | _writeUInt32(buf, value, offset, littleEndian, noAssert) |
| 48417 | else |
| 48418 | _writeUInt32(buf, 0xffffffff + value + 1, offset, littleEndian, noAssert) |
| 48419 | } |
| 48420 | |
| 48421 | Buffer.prototype.writeInt32LE = function (value, offset, noAssert) { |
| 48422 | _writeInt32(this, value, offset, true, noAssert) |
no test coverage detected