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

Bases: abc.ABC

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

unwrap()

Return the currently opened underlying text stream.

Returns:

The stream used for reading text.

Return type:

io.TextIOBase

read(size=-1)

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()

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

seek(offset, whence=os.SEEK_SET)

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()

Return the current stream position.

Returns:

The absolute stream position.

Return type:

int