Why using NIO would be faster? In your tests you state that it's 10
times slower. NIO only has advantages if reading asynchronosly mainly to
save threads. iText doesn't fit in that model. iText is also supposed to
work with other jdk versions below 1.4.



> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Martin Resch (adaptions GmbH)
> Sent: Wednesday, November 10, 2004 10:36 AM
> To: [EMAIL PROTECTED]
> Subject: [iText-questions] Java nio
> 
> Hello,
> 
>       in a PDF i have to include a lot of images. I tried the 
> NIO-package
> to create the bytearray myself and then instance the 
> Image-object like this:
> 
> FileChannel roChannel = new RandomAccessFile(url, "r").getChannel();
> ByteBuffer roBuf = roChannel.map(FileChannel.MapMode.READ_ONLY, 0,
> (int)roChannel.size());
> byte[] ba = new byte[roBuf.capacity()];
> roBuf.get(ba);
> Image img = com.lowagie.text.Image.getInstance(ba);
> 
> 
> But several speedtests shows that this solution is about ten 
> times slower
> then giving the Image.getInstance()-Method simply an string 
> with the path to
> the imagefile.
> 
> Why is this so and couldn't iText support the nio-package for 
> advantage in
> speed?
> 
> 
> Martin
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Sybase ASE Linux Express Edition - download now for FREE
> LinuxWorld Reader's Choice Award Winner for best database on Linux.
> http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id065&op=click
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to