A class implementing a buffer for bytes.
The ByteBuffer class is also used for the input_histoy of serial and parallel ports.
Methods
Create a buffer for bytes.
Parameters name – the name of the buffer (str) clock – an experimental clock (expyriment.Clock object) (optional)
Add an event to the buffer.
Parameters event – the event to add (anything)
Add a list of events to the buffer.
All events get the same time stamp!
Parameters events – the event list to add (list)
Check if bits are set in buffer bytes and return position.
Parameters search_byte – the byte to search for (int) search_start_position – position to start search from (int)
(optional)
Check if bits are NOT set in buffer bytes and return position.
Parameters search_byte – the byte to search for (int) search_start_position – position to start search from (int)
(optional)
Check if value is in buffer bytes and return the position.
Parameters value – the value to check (int) search_start_position – position to start search from (int)
(optional)
Clear the buffer.
Getter for clock
Get an element (code, rt) from the buffer.
Parameters position – the position to get the element from (int)
Get the last event (code, rt) in the buffer.
Return the number of elements in the buffer.
Get a copy of the buffer.
Getter for memory [list of tuples (code, rt)]
Getter for name