|
@ -574,6 +574,7 @@ Buffer.prototype.writeUInt8 = function(value, offset, noAssert) { |
|
|
if (!noAssert) |
|
|
if (!noAssert) |
|
|
checkInt(this, value, offset, 1, 0xff, 0); |
|
|
checkInt(this, value, offset, 1, 0xff, 0); |
|
|
this[offset] = value; |
|
|
this[offset] = value; |
|
|
|
|
|
return offset + 1; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -594,6 +595,7 @@ Buffer.prototype.writeUInt16LE = function(value, offset, noAssert) { |
|
|
if (!noAssert) |
|
|
if (!noAssert) |
|
|
checkInt(this, value, offset, 2, 0xffff, 0); |
|
|
checkInt(this, value, offset, 2, 0xffff, 0); |
|
|
writeUInt16(this, value, offset, false); |
|
|
writeUInt16(this, value, offset, false); |
|
|
|
|
|
return offset + 2; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -603,6 +605,7 @@ Buffer.prototype.writeUInt16BE = function(value, offset, noAssert) { |
|
|
if (!noAssert) |
|
|
if (!noAssert) |
|
|
checkInt(this, value, offset, 2, 0xffff, 0); |
|
|
checkInt(this, value, offset, 2, 0xffff, 0); |
|
|
writeUInt16(this, value, offset, true); |
|
|
writeUInt16(this, value, offset, true); |
|
|
|
|
|
return offset + 2; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -627,6 +630,7 @@ Buffer.prototype.writeUInt32LE = function(value, offset, noAssert) { |
|
|
if (!noAssert) |
|
|
if (!noAssert) |
|
|
checkInt(this, value, offset, 4, 0xffffffff, 0); |
|
|
checkInt(this, value, offset, 4, 0xffffffff, 0); |
|
|
writeUInt32(this, value, offset, false); |
|
|
writeUInt32(this, value, offset, false); |
|
|
|
|
|
return offset + 4; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -636,6 +640,7 @@ Buffer.prototype.writeUInt32BE = function(value, offset, noAssert) { |
|
|
if (!noAssert) |
|
|
if (!noAssert) |
|
|
checkInt(this, value, offset, 4, 0xffffffff, 0); |
|
|
checkInt(this, value, offset, 4, 0xffffffff, 0); |
|
|
writeUInt32(this, value, offset, true); |
|
|
writeUInt32(this, value, offset, true); |
|
|
|
|
|
return offset + 4; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -683,6 +688,7 @@ Buffer.prototype.writeInt8 = function(value, offset, noAssert) { |
|
|
checkInt(this, value, offset, 1, 0x7f, -0x80); |
|
|
checkInt(this, value, offset, 1, 0x7f, -0x80); |
|
|
if (value < 0) value = 0xff + value + 1; |
|
|
if (value < 0) value = 0xff + value + 1; |
|
|
this[offset] = value; |
|
|
this[offset] = value; |
|
|
|
|
|
return offset + 1; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -693,6 +699,7 @@ Buffer.prototype.writeInt16LE = function(value, offset, noAssert) { |
|
|
checkInt(this, value, offset, 2, 0x7fff, -0x8000); |
|
|
checkInt(this, value, offset, 2, 0x7fff, -0x8000); |
|
|
if (value < 0) value = 0xffff + value + 1; |
|
|
if (value < 0) value = 0xffff + value + 1; |
|
|
writeUInt16(this, value, offset, false); |
|
|
writeUInt16(this, value, offset, false); |
|
|
|
|
|
return offset + 2; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -703,6 +710,7 @@ Buffer.prototype.writeInt16BE = function(value, offset, noAssert) { |
|
|
checkInt(this, value, offset, 2, 0x7fff, -0x8000); |
|
|
checkInt(this, value, offset, 2, 0x7fff, -0x8000); |
|
|
if (value < 0) value = 0xffff + value + 1; |
|
|
if (value < 0) value = 0xffff + value + 1; |
|
|
writeUInt16(this, value, offset, true); |
|
|
writeUInt16(this, value, offset, true); |
|
|
|
|
|
return offset + 2; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -713,6 +721,7 @@ Buffer.prototype.writeInt32LE = function(value, offset, noAssert) { |
|
|
checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); |
|
|
checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); |
|
|
if (value < 0) value = 0xffffffff + value + 1; |
|
|
if (value < 0) value = 0xffffffff + value + 1; |
|
|
writeUInt32(this, value, offset, false); |
|
|
writeUInt32(this, value, offset, false); |
|
|
|
|
|
return offset + 4; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -723,4 +732,5 @@ Buffer.prototype.writeInt32BE = function(value, offset, noAssert) { |
|
|
checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); |
|
|
checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); |
|
|
if (value < 0) value = 0xffffffff + value + 1; |
|
|
if (value < 0) value = 0xffffffff + value + 1; |
|
|
writeUInt32(this, value, offset, true); |
|
|
writeUInt32(this, value, offset, true); |
|
|
|
|
|
return offset + 4; |
|
|
}; |
|
|
}; |
|
|