iostream.blob.writeobject
Serializes the object to the stream
Parameters
obj | any | the value to serialize |
classes | table|null | classes the serialized data is allowed to instantiate optional |
Notes
See iostream.stream.writeobject for the generic contract. Writing past the current len grows this blob to fit, the same as writen.
Example
from "iostream" import blob
let b = blob(0) // empty: serializing grows it
b.writeobject([1, 2, 3])
println("b.len() > 0 =", b.len() > 0)
b.seek(0)
let back = b.readobject()
println("back.len(), back[0], back[1], back[2] =", $"{back.len()}:{back[0]},{back[1]},{back[2]}")Output:
b.len() > 0 = true
back.len(), back[0], back[1], back[2] = 3:1,2,3See also
writeobject | Serializes the object to the stream |
readobject | Deserializes an object from the stream |
| blob | class index |