* Check if the optional value is valid * @this {!FinalModelOptional} * @returns {!number} Final model size or Number.MAX_SAFE_INTEGER in case of any error
()
| 4540 | * @returns {!number} Final model size or Number.MAX_SAFE_INTEGER in case of any error |
| 4541 | */ |
| 4542 | verify () { |
| 4543 | if ((this._buffer.offset + this.fbeOffset + 1) > this._buffer.size) { |
| 4544 | return Number.MAX_SAFE_INTEGER |
| 4545 | } |
| 4546 | |
| 4547 | let fbeHasValue = this.readUInt8(this.fbeOffset) |
| 4548 | if (fbeHasValue === 0) { |
| 4549 | return 1 |
| 4550 | } |
| 4551 | |
| 4552 | this._buffer.shift(this.fbeOffset + 1) |
| 4553 | let fbeResult = this.value.verify() |
| 4554 | this._buffer.unshift(this.fbeOffset + 1) |
| 4555 | return 1 + fbeResult |
| 4556 | } |
| 4557 | |
| 4558 | /** |
| 4559 | * Get the optional value |