package sbhpfv1 import ( "io" "git.zervo.org/FLUX/GoSBHPF/pkg/seekablebuffer" ) // SerializeNodeStream serializes a node object into a SBHPF node. // It is a wrapper around SerializeNode that temporarily stores the serialized nodes in a seekable memory buffer. // This is less efficient, but provides compatibility with writers that lack seeking support. func SerializeNodeStream(w io.Writer, node *Node) error { buf := &seekablebuffer.Buffer{} if err := SerializeNode(buf, node); err != nil { return err } _, err := io.Copy(w, buf) return err }