This repository has been archived by the owner. It is now read-only.

Add Buffer::fill() method to do a memset #477

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
4 participants

kkaefer commented Nov 30, 2010

still missing tests

Beware : charCode might be bigger than a byte : 16 bits versus 8 bits !

kkaefer commented Nov 30, 2010

Yeah, throw an exception in that case? Currently it just ignores the upper bits. E.g. a charcode of 256 would be 0 and 257 = 1.

kkaefer commented Nov 30, 2010

I mostly added the start/end for API consistency, but if there's a consensus, I can also remove it.

elarkin commented Dec 3, 2010

This conflicts with an existing buffer set method: See https://github.com/ry/node/blob/master/lib/buffer.js#L191

kkaefer commented Dec 4, 2010

Thanks elarkin, I changed it to "fill" now as xk suggested in ry#472

@ry ry closed this in 5e1b7ca May 6, 2011

ry commented May 6, 2011

thanks. sorry it took so long

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.