check if we have consumed all bytes

We will hit an 'oob' error in node 0.8 if we
call slice() on buffers past then length of
the buffer.