Re: sending image file using RequestFactory takes a long time. what is the correct way ?
On Thursday, February 10, 2011 3:21:52 AM UTC+1, zixzigma wrote: 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 ? No. or could it be converting from byte[] to ListByte ? Neither. in your opinion what is the correct way of sending images to the client ? Either as a data: URL (String), or as requests to a servlet (just like you would request static image files), but absolutely not as byte[] or ListByte, as that isn't very useful on the client-side. -- 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.
sending image file using RequestFactory takes a long time. what is the correct way ?
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(); ListByte getImage(); } I use ListByte, 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 InputSupplierInputStream() { @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 ListByte ? 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.