StreamReader

from panda3d.core import StreamReader
class StreamReader

Bases: DTOOL_SUPER_BASE

A class to read sequential binary data directly from an istream. Its interface is similar to DatagramIterator by design; see also StreamWriter.

Inheritance diagram

Inheritance diagram of StreamReader

__init__(*args, **kwargs)
assign()

C++ Interface: assign(const StreamReader self, const StreamReader copy)

extractBytes()

C++ Interface: extract_bytes(const StreamReader self, int size)

/**
  • Extracts the indicated number of bytes in the stream into the given

  • character buffer. Assumes that the buffer is big enough to hold the

  • requested number of bytes. Returns the number of bytes that were

  • successfully written.

*/

/**
  • Extracts the indicated number of bytes in the stream and returns them as a

  • string. Returns empty string at end-of-file.

*/

extract_bytes()

C++ Interface: extract_bytes(const StreamReader self, int size)

/**
  • Extracts the indicated number of bytes in the stream into the given

  • character buffer. Assumes that the buffer is big enough to hold the

  • requested number of bytes. Returns the number of bytes that were

  • successfully written.

*/

/**
  • Extracts the indicated number of bytes in the stream and returns them as a

  • string. Returns empty string at end-of-file.

*/

getBeFloat32()

C++ Interface: get_be_float32(const StreamReader self)

/**
  • 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.

*/

getBeFloat64()

C++ Interface: get_be_float64(const StreamReader self)

/**
  • Extracts a 64-bit big-endian floating-point number.

*/

getBeInt16()

C++ Interface: get_be_int16(const StreamReader self)

/**
  • Extracts a signed big-endian 16-bit integer.

*/

getBeInt32()

C++ Interface: get_be_int32(const StreamReader self)

/**
  • Extracts a signed big-endian 32-bit integer.

*/

getBeInt64()

C++ Interface: get_be_int64(const StreamReader self)

/**
  • Extracts a signed big-endian 64-bit integer.

*/

getBeUint16()

C++ Interface: get_be_uint16(const StreamReader self)

/**
  • Extracts an unsigned big-endian 16-bit integer.

*/

getBeUint32()

C++ Interface: get_be_uint32(const StreamReader self)

/**
  • Extracts an unsigned big-endian 32-bit integer.

*/

getBeUint64()

C++ Interface: get_be_uint64(const StreamReader self)

/**
  • Extracts an unsigned big-endian 64-bit integer.

*/

getBool()

C++ Interface: get_bool(const StreamReader self)

/**
  • Extracts a boolean value.

*/

getFixedString()

C++ Interface: get_fixed_string(const StreamReader self, int size)

/**
  • Extracts a fixed-length string. However, if a zero byte occurs within the

  • string, it marks the end of the string.

*/

getFloat32()

C++ Interface: get_float32(const StreamReader self)

/**
  • 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.

*/

getFloat64()

C++ Interface: get_float64(const StreamReader self)

/**
  • Extracts a 64-bit floating-point number.

*/

getInt16()

C++ Interface: get_int16(const StreamReader self)

/**
  • Extracts a signed 16-bit integer.

*/

getInt32()

C++ Interface: get_int32(const StreamReader self)

/**
  • Extracts a signed 32-bit integer.

*/

getInt64()

C++ Interface: get_int64(const StreamReader self)

/**
  • Extracts a signed 64-bit integer.

*/

getInt8()

C++ Interface: get_int8(const StreamReader self)

/**
  • Extracts a signed 8-bit integer.

*/

getIstream()

C++ Interface: get_istream(StreamReader self)

/**
  • Returns the stream in use.

*/

getString()

C++ Interface: get_string(const StreamReader self)

/**
  • Extracts a variable-length string.

*/

getString32()

C++ Interface: get_string32(const StreamReader self)

/**
  • Extracts a variable-length string with a 32-bit length field.

*/

getUint16()

C++ Interface: get_uint16(const StreamReader self)

/**
  • Extracts an unsigned 16-bit integer.

*/

getUint32()

C++ Interface: get_uint32(const StreamReader self)

/**
  • Extracts an unsigned 32-bit integer.

*/

getUint64()

C++ Interface: get_uint64(const StreamReader self)

/**
  • Extracts an unsigned 64-bit integer.

*/

getUint8()

C++ Interface: get_uint8(const StreamReader self)

/**
  • Extracts an unsigned 8-bit integer.

*/

getZString()

C++ Interface: get_z_string(const StreamReader self)

/**
  • Extracts a variable-length string, as a NULL-terminated string.

*/

get_be_float32()

C++ Interface: get_be_float32(const StreamReader self)

/**
  • 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.

*/

get_be_float64()

C++ Interface: get_be_float64(const StreamReader self)

/**
  • Extracts a 64-bit big-endian floating-point number.

*/

get_be_int16()

C++ Interface: get_be_int16(const StreamReader self)

/**
  • Extracts a signed big-endian 16-bit integer.

*/

get_be_int32()

C++ Interface: get_be_int32(const StreamReader self)

/**
  • Extracts a signed big-endian 32-bit integer.

*/

get_be_int64()

C++ Interface: get_be_int64(const StreamReader self)

/**
  • Extracts a signed big-endian 64-bit integer.

*/

get_be_uint16()

C++ Interface: get_be_uint16(const StreamReader self)

/**
  • Extracts an unsigned big-endian 16-bit integer.

*/

get_be_uint32()

C++ Interface: get_be_uint32(const StreamReader self)

/**
  • Extracts an unsigned big-endian 32-bit integer.

*/

get_be_uint64()

C++ Interface: get_be_uint64(const StreamReader self)

/**
  • Extracts an unsigned big-endian 64-bit integer.

*/

get_bool()

C++ Interface: get_bool(const StreamReader self)

/**
  • Extracts a boolean value.

*/

get_fixed_string()

C++ Interface: get_fixed_string(const StreamReader self, int size)

/**
  • Extracts a fixed-length string. However, if a zero byte occurs within the

  • string, it marks the end of the string.

*/

get_float32()

C++ Interface: get_float32(const StreamReader self)

/**
  • 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.

*/

get_float64()

C++ Interface: get_float64(const StreamReader self)

/**
  • Extracts a 64-bit floating-point number.

*/

get_int16()

C++ Interface: get_int16(const StreamReader self)

/**
  • Extracts a signed 16-bit integer.

*/

get_int32()

C++ Interface: get_int32(const StreamReader self)

/**
  • Extracts a signed 32-bit integer.

*/

get_int64()

C++ Interface: get_int64(const StreamReader self)

/**
  • Extracts a signed 64-bit integer.

*/

get_int8()

C++ Interface: get_int8(const StreamReader self)

/**
  • Extracts a signed 8-bit integer.

*/

get_istream()

C++ Interface: get_istream(StreamReader self)

/**
  • Returns the stream in use.

*/

get_string()

C++ Interface: get_string(const StreamReader self)

/**
  • Extracts a variable-length string.

*/

get_string32()

C++ Interface: get_string32(const StreamReader self)

/**
  • Extracts a variable-length string with a 32-bit length field.

*/

get_uint16()

C++ Interface: get_uint16(const StreamReader self)

/**
  • Extracts an unsigned 16-bit integer.

*/

get_uint32()

C++ Interface: get_uint32(const StreamReader self)

/**
  • Extracts an unsigned 32-bit integer.

*/

get_uint64()

C++ Interface: get_uint64(const StreamReader self)

/**
  • Extracts an unsigned 64-bit integer.

*/

get_uint8()

C++ Interface: get_uint8(const StreamReader self)

/**
  • Extracts an unsigned 8-bit integer.

*/

get_z_string()

C++ Interface: get_z_string(const StreamReader self)

/**
  • Extracts a variable-length string, as a NULL-terminated string.

*/

istream
readline()

C++ Interface: readline(const StreamReader self)

/**
  • Assumes the stream represents a text file, and extracts one line up to and

  • including the trailing newline character. Returns empty string when the

  • end of file is reached.

  • The interface here is intentionally designed to be similar to that for

  • Python’s File.readline() function.

*/

readlines()

C++ Interface: readlines(const StreamReader self)

skipBytes()

C++ Interface: skip_bytes(const StreamReader self, int size)

/**
  • Skips over the indicated number of bytes in the stream.

*/

skip_bytes()

C++ Interface: skip_bytes(const StreamReader self, int size)

/**
  • Skips over the indicated number of bytes in the stream.

*/