`SmileGenerator._writeIntegralNumber()` / `_writeDecimalNumber()` (used by `writeNumber(String)`) guard against too-long number Strings via `_streamReadConstraints().validateIntegerLength()` / `validateFPLength()`.
But `_streamReadConstraints()` returns `StreamReadConstraints.defaults()`, so a `maxNumberLength` configured on the `SmileFactory` is ignored on the write path — both a lower limit (not enforced) and a higher limit (spuriously rejected).
Since `IOContext` carries the factory's `StreamReadConstraints` (2.15+), the generator can use `_ioContext.streamReadConstraints()` instead.
`SmileGenerator._writeIntegralNumber()` / `_writeDecimalNumber()` (used by `writeNumber(String)`) guard against too-long number Strings via `_streamReadConstraints().validateIntegerLength()` / `validateFPLength()`.
But `_streamReadConstraints()` returns `StreamReadConstraints.defaults()`, so a `maxNumberLength` configured on the `SmileFactory` is ignored on the write path — both a lower limit (not enforced) and a higher limit (spuriously rejected).
Since `IOContext` carries the factory's `StreamReadConstraints` (2.15+), the generator can use `_ioContext.streamReadConstraints()` instead.