DatagramOutputFile

from acron.core import DatagramOutputFile
class DatagramOutputFile

Bases:

Bases: DatagramSink

This class can be used to write a binary file that consists of an arbitrary header followed by a number of datagrams.

Inheritance diagram

digraph inheritance14fdd65aa9 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "DatagramOutputFile" [URL="acron.core.DatagramOutputFile.html#acron.core.DatagramOutputFile",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DatagramSink" -> "DatagramOutputFile" [arrowsize=0.75,style=""]; "DatagramSink" [URL="acron.core.DatagramSink.html#acron.core.DatagramSink",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "DatagramSink" [arrowsize=0.75,style=""]; }
__init__()
close()

Closes the file. This is also implicitly done when the DatagramOutputFile destructs.

open()

Opens the indicated filename for writing. Returns true on success, false on failure.

Opens the indicated filename for writing. Returns true if successful, false on failure.

Starts writing to the indicated stream. Returns true on success, false on failure. The DatagramOutputFile does not take ownership of the stream; you are responsible for closing or deleting it when you are done.

property stream → ostream

Returns the ostream represented by the output file.

write_header()

Writes a sequence of bytes to the beginning of the datagram file. This may be called any number of times after the file has been opened and before the first datagram is written. It may not be called once the first datagram is written.

Writes a sequence of bytes to the beginning of the datagram file. This may be called any number of times after the file has been opened and before the first datagram is written. It may not be called once the first datagram is written.