Previous topic

spinnman.data.abstract_byte_writer module

Next topic

spinnman.data.big_endian_byte_array_byte_reader module

This Page

spinnman.data.abstract_data_reader module

class spinnman.data.abstract_data_reader.AbstractDataReader[source]

Bases: object

Abstract Methods

read(n_bytes) Read a number of bytes from the underlying stream
readall() Read the rest of the bytes from the underlying stream
readinto(array) Read a number of bytes into an array from the underlying stream

Detailed Methods

read(n_bytes)[source]

Read a number of bytes from the underlying stream

Parameters:n_bytes (int) – The number of bytes to read.
Returns:The bytes read from the underlying stream. May be less than requested.
Return type:bytearray
Raises IOError:If there is an error obtaining the bytes
readall()[source]

Read the rest of the bytes from the underlying stream

Returns:The bytes read
Return type:bytearray
Raises IOError:If there is an error obtaining the bytes
readinto(array)[source]

Read a number of bytes into an array from the underlying stream

Parameters:array (bytearray) – An array into which the bytes are to be read
Returns:The number of bytes written in to the array
Return type:int
Raises IOError:If there is an error obtaining the bytes