'Return \'n\' bytes from the buffer, without draining them.
If \'n\' is negative, return the whole buffer.
If \'n\' is larger than the size of the buffer, return the whole
buffer.'

def peek(self, n=(-1)):

    with self.data_lock:
        if ((n < 0) or (n > len(self.buffer))):
            return self.buffer
        return self.buffer[:n]
