I'll have a look.
Paulo
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Michael Schierl
> Sent: Sunday, December 16, 2007 6:48 PM
> To: Post all your questions about iText here
> Subject: [iText-questions] [PATCH] Suggestion: Add
> SeekableInput interface
>
> Hello,
>
> Current iText has a disadvantage for me: it only supports
> RandomAccessFiles or arrays as source for the PDF. Other
> seekable inputs
> like Blobs (from java.sql) cannot be used. So I suggest to add an
> interface SeekableInput and a constructor to RandomAccessFileOrArray
> that takes an instance of this interface as parameter. In the
> long term,
> it might be a good idea to rename the RandomAccessFileOrArray
> class (or
> to eliminate it totally where applicable), but that is not necessary.
>
> The zip file attached contains 3 new files, a patch for
> RandomAccessFileOrArray, and the new version of this file
> after applying
> this patch to revision 3079 (latest at time of writing this).
>
> It introduces a new interface, SeekableInput, that can be used to
> implement other seekable input classes and looks like this:
>
> ----------
> package com.lowagie.text.pdf;
>
> import java.io.IOException;
>
> public interface SeekableInput {
>
> public void close() throws IOException;
> public int getFilePointer() throws IOException;
> public boolean isOpen();
> public int length() throws IOException;
> public int read() throws IOException;
> public int read(byte b[], int off, int len) throws IOException;
> public void reOpen() throws IOException;
> public void seek(int pos) throws IOException;
> }
> ---------
>
> Two classes, SeekableArrayInput and SeekableFileInput, implement this
> interface and incorporate the pieces from RandomAccessFileOrArray that
> are specific for files or array.
>
> RandomAccessFileOrArray has a new constructor that takes SeekableInput
> instances. The old constructors create appropriate
> Seekable(Array|File)Input instances. Some of the old methods in
> RandomAccessFileOrArray call the interface methods now.
>
> The patch was tested by running a few of the jPdfTweak tests
> against the
> patched iText library. Its behaviour should be 100% equivalent before
> and after the change.
>
> What do you think about it?
>
> Michael
>
>
Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
informação confidencial ou legalmente protegida. A incorrecta transmissão desta
mensagem não significa a perca de confidencialidade. Se esta mensagem for
recebida por engano, por favor envie-a de volta para o remetente e apague-a do
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de
usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may contain
confidential or legally protected information. The incorrect transmission of
this message does not mean the loss of its confidentiality. If this message is
received by mistake, please send it back to the sender and delete it from your
system immediately. It is forbidden to any person who is not the intended
receiver to use, distribute or copy any part of this message.
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/