CFBStream

Overview

CFBStream is a mutable STREAM_OBJECT node that stores raw binary data within a CFBDocument or CFBStorage. It exposes the metadata fields defined by the CFB specification and allows the data payload to be set freely before the document is serialized via CFBWriter.

from aspose.email_foss.cfb import CFBDocument, CFBStream, CFBWriter

doc = CFBDocument.from_file("archive.cfb")
s = CFBStream()
s.name = "NewData"
s.data = b"\x01\x02\x03"
doc.root.children.append(s)
CFBWriter.write_file(doc, "updated.cfb")

Properties

PropertyTypeDescription
namestrName of this stream entry as it appears in the CFB directory.
databytesRaw binary content of the stream; defaults to b"".
clsidbytes16-byte CLSID associated with this stream entry, or 16 zero bytes if absent.
state_bitsintUser-defined state bits stored in the CFB directory entry.
creation_timeFileTimeCreation timestamp as a FileTime value.
modified_timeFileTimeLast-modified timestamp as a FileTime value.

See Also