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

Bases: abc.ABC

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

unwrap()

Return the currently opened underlying stream.

Returns:

The stream used for reading and writing data.

Return type:

io.IOBase

read(size=-1)

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

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