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

Method clone

projects/JavaScript/proto/test.js:12637–12646  ·  view source on GitHub ↗

* Clone struct (deep clone) * @this {!StructBytes} * @returns {!StructBytes} Cloned struct

()

Source from the content-addressed store, hash-verified

12635 * @returns {!StructBytes} Cloned struct
12636 */
12637 clone () {
12638 // Serialize the struct to the FBE stream
12639 let writer = new StructBytesModel(new fbe.WriteBuffer())
12640 writer.serialize(this)
12641
12642 // Deserialize the struct from the FBE stream
12643 let reader = new StructBytesModel(new fbe.ReadBuffer())
12644 reader.attachBuffer(writer.buffer)
12645 return reader.deserialize().value
12646 }
12647
12648 /**
12649 * Is this struct equal to other one?

Callers

nothing calls this directly

Calls 3

serializeMethod · 0.95
deserializeMethod · 0.95
attachBufferMethod · 0.45

Tested by

no test coverage detected