DatagramInputFile

from acron.core import DatagramInputFile
class DatagramInputFile

Bases:

Bases: DatagramGenerator

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

Inheritance diagram

digraph inheritance3fc881dee8 { 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=""]; "DatagramGenerator" [URL="acron.core.DatagramGenerator.html#acron.core.DatagramGenerator",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" -> "DatagramGenerator" [arrowsize=0.75,style=""]; "DatagramInputFile" [URL="acron.core.DatagramInputFile.html#acron.core.DatagramInputFile",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DatagramGenerator" -> "DatagramInputFile" [arrowsize=0.75,style=""]; }
__init__()
close()

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

get_stream()

Returns the istream represented by the input file.

open()

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

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

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

static read_header()

Reads a sequence of bytes from 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 read. It may not be called once the first datagram has been read.