docs: def getRGBData(self):
          "Return byte array of RGB data as string"
          if self._data is None:
              self._dataA = None
              if sys.platform[0:4] == 'java':
                  import jarray  # TODO: Move to top.
                  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 rgb in buffer:
                      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':
                      im.load()
                      self._dataA = PmlImageReader(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'):
                      self._data = im.tobytes()
                  else:
                      # PIL compatibility
                      self._data = im.tostring()
          return self._data