def read(self, n=4096):

        size = self._next_packet_size(n)

        if size <= 0:
            return
        else:
            data = six.binary_type()
            while len(data) < size:
                nxt = self.stream.read(size - len(data))
                if not nxt:
                    # the stream has closed, return what data we got
                    return data
                data = data + nxt
            return data
Read up to `n` bytes of data from the Stream, after demuxing.
dataset/ETHPy150Open d11wtq/dockerpty/dockerpty/io.py/Demuxer.read