httk.core.datastream.textstream_common

Classes

TextstreamCommon

Common superclass for many of the implementations of backends for streaming text data.

Module Contents

class httk.core.datastream.textstream_common.TextstreamCommon[source]

Bases: abc.ABC

Common superclass for many of the implementations of backends for streaming text data.

unwrap()[source]

Return the currently opened underlying text stream.

Returns:

The stream used for reading text.

Return type:

io.TextIOBase

read(size=-1)[source]

Read up to size characters, or all remaining characters when size is negative.

Parameters:

size (int) – Maximum number of characters to read.

Returns:

The text read from the stream.

Return type:

str

close()[source]

Close the opened stream and any source stream owned by it.

seek(offset, whence=os.SEEK_SET)[source]

Move the stream position.

Parameters:
  • offset (int) – Position adjustment interpreted according to whence.

  • whence (int) – Reference point for offset.

Returns:

The resulting absolute stream position.

Return type:

int

tell()[source]

Return the current stream position.

Returns:

The absolute stream position.

Return type:

int