nextPut method

bool nextPut(
  1. int byte, {
  2. void onEnd()?,
})

Put the next byte into the buffer.

If there are no unwrittenCount left, then evaluate the optional onEnd function and return false. Otherwise, return true.

Implementation

bool nextPut(int byte, {void Function()? onEnd}) {
  if (isFull()) {
    onEnd?.call();
    return false;
  } else {
    basicNextPut(byte);
    return true;
  }
}