def getRGBData(self):
        "Return byte array of RGB data as string"
        try:
            if self._data is None:
                self._dataA = None
                if sys.platform[0:4] == 'java':
                    import jarray
                    from java.awt.image import PixelGrabber
                    width, height = self.getSize()
                    buffer = jarray.zeros(width*height, 'i')
                    pg = PixelGrabber(self._image, 0,0,width,height,buffer,0,width)
                    pg.grabPixels()
                    # there must be a way to do this with a cast not a byte-level loop,
                    # I just haven't found it yet...
                    pixels = []
                    a = pixels.append
                    for i in range(len(buffer)):
                        rgb = buffer[i]
                        a(chr((rgb>>16)&0xff))
                        a(chr((rgb>>8)&0xff))
                        a(chr(rgb&0xff))
                    self._data = ''.join(pixels)
                    self.mode = 'RGB'
                else:
                    im = self._image
                    mode = self.mode = im.mode
                    if mode=='RGBA':
                        if Image.VERSION.startswith('1.1.7'): im.load()
                        self._dataA = ImageReader(im.split()[3])
                        im = im.convert('RGB')
                        self.mode = 'RGB'
                    elif mode not in ('L','RGB','CMYK'):
                        im = im.convert('RGB')
                        self.mode = 'RGB'
                    if hasattr(im, 'tobytes'):  #make pillow and PIL both happy, for now
                        self._data = im.tobytes()
                    else:
                        self._data = im.tostring()
            return self._data
        except:
            annotateException('\nidentity=%s'%self.identity())