Skip to content

Instantly share code, notes, and snippets.

@katlogic
Last active August 29, 2015 14:01
Show Gist options
  • Save katlogic/dbfb2e5de7636a5d67e5 to your computer and use it in GitHub Desktop.
Save katlogic/dbfb2e5de7636a5d67e5 to your computer and use it in GitHub Desktop.
'use strict'
let inherits = require('util').inherits
let Buffer = function(a,b)
{
if (!(this instanceof Buffer))
return new Buffer(a, b)
return Uint8Array.call(this,a,b)
}
inherits(Uint8Array, Buffer)
let x = new Buffer(12)
console.log(x instanceof Buffer)
console.log(x instanceof Uint8Array)
console.log(x.slice)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment