StreamWriter¶
from panda3d.core import StreamWriter
-
class
StreamWriter
¶ A StreamWriter object is used to write sequential binary data directly to an ostream. Its interface is very similar to Datagram by design; it’s primarily intended as a convenience to eliminate the overhead of writing bytes to a Datagram and then writing the Datagram to a stream.
Inheritance diagram
-
__init__
(copy: StreamWriter)¶ The copy constructor does not copy ownership of the stream.
-
addBeFloat32
(value: float) → None¶ Adds a 32-bit single-precision big-endian floating-point number to the stream. Since this kind of float is not necessarily portable across different architectures, special care is required.
-
addBeFloat64
(value: float) → None¶ Adds a 64-bit big-endian floating-point number to the streamWriter.
-
addFixedString
(str: str, size: int) → None¶ Adds a fixed-length string to the stream. If the string given is less than the requested size, this will pad the string out with zeroes; if it is greater than the requested size, this will silently truncate the string.
-
addFloat32
(value: float) → None¶ Adds a 32-bit single-precision floating-point number to the stream. Since this kind of float is not necessarily portable across different architectures, special care is required.
-
addString
(str: str) → None¶ Adds a variable-length string to the stream. This actually adds a count followed by n bytes.
-
addString32
(str: str) → None¶ Adds a variable-length string to the stream, using a 32-bit length field.
-
addZString
(str: str) → None¶ Adds a variable-length string to the stream, as a NULL-terminated string.
-
assign
(copy: StreamWriter) → StreamWriter¶
-
property
softspace
→ int¶ Python 2 needs this for printing to work correctly.
- Getter
getter for int StreamWriter::softspace;
- Setter
setter for int StreamWriter::softspace;
-
write
(str: str) → None¶ A synonym of
appendData()
. This is useful when assigning theStreamWriter
to sys.stderr and/or sys.stdout in Python.
-