Hi Stokes,

You may have an encoding issue in the chain. One test you could do is write
your representation in a local file and try to open it locally. That will
rule out some potential causes. Just do something like:

        myRepresentation.write(new FileOutputStream("myImage.jpg"));

Best regards,
Jerome  

> -----Message d'origine-----
> De : news [mailto:[EMAIL PROTECTED] De la part de Stokes
> Envoyé : lundi 5 mars 2007 21:12
> À : [email protected]
> Objet : Problems (data corruption?) streaming JPEG image
> 
> I have a JPEG image stored as a stream in my database.  I 
> read that into a
> byte[] array, and then I'm trying to serve that using a 
> Restlet Resource.  My
> resource class returns an InputRepresentation made of the 
> byte[] array and
> MediaType.IMAGE_JPEG.
> The result when I test from a browser is that the correct 
> number of bytes get
> streamed, but when rendered the image looks jumbled and 
> corrupt.  Had anyone had
> success doing something like this?
> 
> Stokes.

Reply via email to