Add len method to ReadWriteStream

pull/81/head
Matthew D. Scholefield 2019-05-15 02:32:53 -05:00
parent 507d50e4c5
commit 7ca5673ddc
1 changed files with 3 additions and 0 deletions

View File

@ -83,6 +83,9 @@ class ReadWriteStream(object):
self.write_event = Event()
self.chop_samples = chop_samples
def __len__(self):
return len(self.buffer)
def read(self, n=-1, timeout=None):
if n == -1:
n = len(self.buffer)