Data.shiftWhile()
Description
Removes bytes from the beginning until user callback returns false.
The scanner parameter will be called once for each byte in Data. It returns falsy to indicate the last byte to NOT shift out. Compare to shiftTo().
Syntax
data.shiftWhile(byte => shouldShiftOut(byte))
Parameters
shiftWhile(callback)
callback
A function that receives each byte being removed and returns false for the first byte to keep.
Return Value
A Data object containing bytes removed from the beginning.