'Read data from RAW file.
Args:
size: Number of bytes to read as integer. Actual number of bytes
read is always equal to size unless end if file was reached.
Returns:
A string with data read.'

def read(self, size=None):

    if (size is None):
        size = sys.maxint
    data_list = []
    while True:
        result = self.__readBuffer(size)
        data_list.append(result)
        size -= len(result)
        if ((size == 0) or self._eof):
            return ''.join(data_list)
        self.__refillBuffer()
