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