Re: Can't call Representation.getText() or getStream() twice?

2007-05-21 Thread Stian Soiland
On 18 May 2007, at 21:07, Philip Johnson wrote: public void put(Representation entity) { System.out.println(entity.getText()); System.out.println(entity.getText()); The first call to getText() would basically do a getStream() and read all the data until the end, and return as a

RE: Can't call Representation.getText() or getStream() twice?

2007-05-19 Thread Jerome Louvel
@restlet.tigris.org Objet : Re: Can't call Representation.getText() or getStream() twice? Thank you Theirry and Jerome for the lightening quick responses! I see the rationale for the behavior now. It might be helpful to document this behavior more clearly in the JavaDoc at some point, maybe

Re: Can't call Representation.getText() or getStream() twice?

2007-05-18 Thread Thierry Boileau
Hello Philip, the getText() method reads entirely the underlining stream in order to build a String object. That means that you can only call this method once. However, I don't know if this behaviour is expected or appropriate. I hope I answer your question. Best regards, Thierry Boileau