'Read bytes from the stream at specified address (in bits).
Address have to be a multiple of 8.
nbytes have to in 1..MAX_READ_NBYTES (64 KB).
This method is only supported for StringOuputStream (not on
FileOutputStream).
Return read bytes as byte string.'

def readBytes(self, address, nbytes):

    assert ((address % 8) == 0)
    assert (1 <= nbytes <= MAX_READ_NBYTES)
    self._output.flush()
    oldpos = self._output.tell()
    try:
        self._output.seek(0)
        try:
            return self._output.read(nbytes)
        except IOError as err:
            if (err[0] == EBADF):
                raise OutputStreamError("Stream    doesn't    support    read()    operation")
    finally:
        self._output.seek(oldpos)
