MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / getBegin

Method getBegin

projects/JavaScript/proto/fbe.js:2247–2260  ·  view source on GitHub ↗

* Get the optional value (being phase) * @this {!FieldModelOptional} * @returns {!number} Optional begin offset

()

Source from the content-addressed store, hash-verified

2245 * @returns {!number} Optional begin offset
2246 */
2247 getBegin () {
2248 if (!this.hasValue) {
2249 return 0
2250 }
2251
2252 let fbeOptionalOffset = this.readUInt32(this.fbeOffset + 1)
2253 console.assert((fbeOptionalOffset > 0), 'Model is broken!')
2254 if (fbeOptionalOffset <= 0) {
2255 return 0
2256 }
2257
2258 this._buffer.shift(fbeOptionalOffset)
2259 return fbeOptionalOffset
2260 }
2261
2262 /**
2263 * Get the optional value (end phase)

Callers 1

getMethod · 0.95

Calls 2

readUInt32Method · 0.45
shiftMethod · 0.45

Tested by

no test coverage detected