}
Buffer.prototype.equals = function (b) {
- if(!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
+ if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
return Buffer.compare(this, b) === 0
}
throw new RangeError('Trying to access beyond buffer length')
}
-Buffer.prototype.readUIntLE = function(offset, byteLength, noAssert) {
+Buffer.prototype.readUIntLE = function (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert)
return val
}
-Buffer.prototype.readUIntBE = function(offset, byteLength, noAssert) {
+Buffer.prototype.readUIntBE = function (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert)
this[offset + 3])
}
-Buffer.prototype.readIntLE = function(offset, byteLength, noAssert) {
+Buffer.prototype.readIntLE = function (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert)
return val
}
-Buffer.prototype.readIntBE = function(offset, byteLength, noAssert) {
+Buffer.prototype.readIntBE = function (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert)
if (offset + ext > buf.length) throw new RangeError('index out of range')
}
-Buffer.prototype.writeUIntLE = function(value, offset, byteLength, noAssert) {
+Buffer.prototype.writeUIntLE = function (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
byteLength = byteLength >>> 0
return offset + byteLength
}
-Buffer.prototype.writeUIntBE = function(value, offset, byteLength, noAssert) {
+Buffer.prototype.writeUIntBE = function (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
byteLength = byteLength >>> 0
return offset + 4
}
-Buffer.prototype.writeIntLE = function(value, offset, byteLength, noAssert) {
+Buffer.prototype.writeIntLE = function (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) {
return offset + byteLength
}
-Buffer.prototype.writeIntBE = function(value, offset, byteLength, noAssert) {
+Buffer.prototype.writeIntBE = function (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) {
}
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
-Buffer.prototype.copy = function(target, target_start, start, end) {
+Buffer.prototype.copy = function (target, target_start, start, end) {
var source = this
if (!start) start = 0
function utf8ToBytes(string, units) {
var codePoint, length = string.length
var leadSurrogate = null
- var units = units || Infinity
+ units = units || Infinity
var bytes = []
var i = 0