JavaScript/Ajax has no means to deal with returned binary data. And really, what could you possibly do with it?
If you're trying to get an image displayed dynamically, just create an <img> tag whose URL references the
servlet that fetches and returns the image data.