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

Method deserialize

projects/JavaScript/proto/protoex.js:3623–3636  ·  view source on GitHub ↗

* Deserialize the struct value * @this {!AccountModel} * @param {!Account} value Account value, defaults is new Account() * @return {!object} Deserialized Account value and its size

(value = new Account())

Source from the content-addressed store, hash-verified

3621 * @return {!object} Deserialized Account value and its size
3622 */
3623 deserialize (value = new Account()) {
3624 if ((this.buffer.offset + this.model.fbeOffset - 4) > this.buffer.size) {
3625 return { value: new Account(), size: 0 }
3626 }
3627
3628 let fbeFullSize = this.readUInt32(this.model.fbeOffset - 4)
3629 console.assert((fbeFullSize >= this.model.fbeSize), 'Model is broken!')
3630 if (fbeFullSize < this.model.fbeSize) {
3631 return { value: new Account(), size: 0 }
3632 }
3633
3634 this.model.get(value)
3635 return { value: value, size: fbeFullSize }
3636 }
3637
3638 /**
3639 * Move to the next struct value

Callers 1

cloneMethod · 0.95

Calls 2

readUInt32Method · 0.45
getMethod · 0.45

Tested by

no test coverage detected