libtcspc.BinaryFileInputStream

final class libtcspc.BinaryFileInputStream(filename, *, start_offset=0)[source]

Bases: InputStream

Binary input stream that reads from a file on disk.

Parameters:
  • filename (str or Param[str]) – Path to the file to read.

  • start_offset (int or Param[int], keyword-only) – Byte offset within the file at which to begin reading. Must be non-negative. Default 0.

Raises:

ValueError – If start_offset is a negative integer, or a Param whose default_value is negative.

Notes

The file is opened with unbuffered I/O. Failure to open the file, or a file shorter than start_offset, is reported when the downstream ReadBinaryStream performs its first read.

See also

ReadBinaryStream

Processor that consumes this stream.

tcspc::binary_file_input_stream()

The underlying C++ input stream.