'Read the first \'size\' bytes in packet and advance cursor past them.'

def read(self, size):

    result = self._data[self._position:(self._position + size)]
    if (len(result) != size):
        error = ('Result    length    not    requested    length:\nExpected=%s.        Actual=%s.        Position:    %s.        Data    Length:    %s' % (size, len(result), self._position, len(self._data)))
        if DEBUG:
            print(error)
            self.dump()
        raise AssertionError(error)
    self._position += size
    return result
