How to use the prototype function from buffer

Find comprehensive JavaScript buffer.prototype code examples handpicked from public code repositorys.

121
122
123
124
125
126
127
128
129
130
    if (typeof end == 'undefined') end = this.length;
    return iconv.decode(this.slice(start, end), encoding);
}

original.BufferWrite = Buffer.prototype.write;
Buffer.prototype.write = function(string, offset, length, encoding) {
    var _offset = offset, _length = length, _encoding = encoding;
    // Support both (string, offset, length, encoding)
    // and the legacy (string, encoding, offset, length)
    if (isFinite(offset)) {
fork icon0
star icon0
watch icon2

+ 5 other calls in file

2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
function stringtrim (str) {
  if (str.trim) return str.trim()
  return str.replace(/^\s+|\s+$/g, '')
}


var BP = Buffer.prototype


/**
 * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods
 */
fork icon0
star icon0
watch icon1