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

Method clone

projects/JavaScript/proto/enums.js:2943–2952  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

2941 * @returns {!Enums} Cloned struct
2942 */
2943 clone () {
2944 // Serialize the struct to the FBE stream
2945 let writer = new EnumsModel(new fbe.WriteBuffer())
2946 writer.serialize(this)
2947
2948 // Deserialize the struct from the FBE stream
2949 let reader = new EnumsModel(new fbe.ReadBuffer())
2950 reader.attachBuffer(writer.buffer)
2951 return reader.deserialize().value
2952 }
2953
2954 /**
2955 * Is this struct equal to other one?

Callers 1

test_clone.jsFile · 0.45

Calls 3

serializeMethod · 0.95
deserializeMethod · 0.95
attachBufferMethod · 0.45

Tested by

no test coverage detected