StreamReader
from panda3d.core import StreamReader
- class StreamReader
Bases:
A class to read sequential binary data directly from an istream. Its interface is similar to
DatagramIterator
by design; see alsoStreamWriter
.Inheritance diagram
- __init__(copy: StreamReader)
The copy constructor does not copy ownership of the stream.
- __init__(in: istream, owns_stream: bool)
If owns_stream is true, the stream pointer will be deleted when the
StreamReader
destructs.
- assign(copy: StreamReader) StreamReader
- extractBytes(size: int) object
Extracts the indicated number of bytes in the stream and returns them as a string. Returns empty string at end-of-file.
- getBeFloat32() float
Extracts a 32-bit single-precision big-endian floating-point number. Since this kind of float is not necessarily portable across different architectures, special care is required.
- getFixedString(size: int) str
Extracts a fixed-length string. However, if a zero byte occurs within the string, it marks the end of the string.
- getFloat32() float
Extracts a 32-bit single-precision floating-point number. Since this kind of float is not necessarily portable across different architectures, special care is required.
- getInt8() int8_t
Extracts a signed 8-bit integer.
- getUint8() uint8_t
Extracts an unsigned 8-bit integer.