httk.core.datastream.bytestream_common

Classes

BytestreamCommon

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

Module Contents

class httk.core.datastream.bytestream_common.BytestreamCommon[source]

Bases: abc.ABC

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

unwrap()[source]

Return the currently opened underlying stream.

Returns:

The stream used for reading and writing data.

Return type:

io.IOBase

read(size=-1)[source]

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

Parameters:

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

Returns:

The bytes read from the stream.

Return type:

bytes

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