What is the correct way to send images from server to the client ?

this is my image proxy:

public interface ImageProxy extends ValueProxy {
    String getName();
    List<Byte> getImage();
}

I use List<Byte>, because byte[] is not accepted by RequestFactory.

I use Guava Bytes.toArray and Bytes.asList to convert back and forth.

However it takes 30 seconds, to send just one 50K file !

the image file resides in classpath, I read the file in the following 
fashion:

public byte[] content(final File file) {

return ByteStreams.toByteArray(new InputSupplier<InputStream>() {
                @Override
                public InputStream getInput() throws IOException {
                    return new FileInputStream(file);
                }
            });
}

I put the image file on classpath and read it as shown above,
my intention is to keep things simple before using a DB.
do you think this might be the reason behind the delay ?
or could it be converting from byte[] to List<Byte>  ?

in your opinion what is the correct way of sending images to the client ?
I want to fetch 10-15 images per request, each image 50K.
however at the moment I am sending ONLY  ONE 50k image and it takes 30 
seconds in hosted mode.

do you have any suggestions ?

Thank You

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to