writeSimple method

void writeSimple(
  1. int value
)
inherited

Simple values, negative values, values over 255 or less than 0 will be encoded as an int.

Implementation

void writeSimple(int value) {
  if (!value.isNegative) {
    if ((value <= simpleLimitUpper) && (value >= simpleLimitLower)) {
      if (value <= ai23) {
        _writeSpecial(value);
      } else {
        _writeSpecial(ai24);
        _out.putByte(value);
      }
    } else {
      _writeInt(value);
    }
  } else {
    _writeInt(value);
  }
  _builderHookImpl(true);
}