(buf, value, offset, littleEndian, noAssert)
| 1715 | } |
| 1716 | |
| 1717 | function _writeInt32 (buf, value, offset, littleEndian, noAssert) { |
| 1718 | if (!noAssert) { |
| 1719 | assert(value !== undefined && value !== null, 'missing value') |
| 1720 | assert(typeof littleEndian === 'boolean', 'missing or invalid endian') |
| 1721 | assert(offset !== undefined && offset !== null, 'missing offset') |
| 1722 | assert(offset + 3 < buf.length, 'Trying to write beyond buffer length') |
| 1723 | verifsint(value, 0x7fffffff, -0x80000000) |
| 1724 | } |
| 1725 | |
| 1726 | var len = buf.length |
| 1727 | if (offset >= len) |
| 1728 | return |
| 1729 | |
| 1730 | if (value >= 0) |
| 1731 | _writeUInt32(buf, value, offset, littleEndian, noAssert) |
| 1732 | else |
| 1733 | _writeUInt32(buf, 0xffffffff + value + 1, offset, littleEndian, noAssert) |
| 1734 | } |
| 1735 | |
| 1736 | Buffer.prototype.writeInt32LE = function (value, offset, noAssert) { |
| 1737 | _writeInt32(this, value, offset, true, noAssert) |
no test coverage detected