addByte method

  1. @override
void addByte(
  1. int byte
)
override

Appends byte to the current contents of this builder.

The byte will be truncated to an 8-bit value in the range 0 .. 255.

Implementation

@override
void addByte(int byte) {
  if (_buffer.length == _length) {
    // The grow algorithm always at least doubles.
    // If we added one to _length it would quadruple unnecessarily.
    _grow(_length);
  }
  _buffer[_length] = byte;
  _length++;
}