# panda3d.core.DatagramInputFile¶

class DatagramInputFile

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

Inheritance diagram

__init__() → None
open(file: FileReference) → bool

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

open(filename: Filename) → bool

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

open(in: istream, filename: Filename) → bool

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.

getStream() → istream

Returns the istream represented by the input file.

Return type

istream

close() → None

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