openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miłosz Tylenda <mtyle...@o2.pl>
Subject Re: Possible to re-read InputStream when using LOB Streaming ?
Date Mon, 22 Nov 2010 16:07:51 GMT
Hi,

If you know up-front the number of bytes you need to analyze the message, you can consider
wrapping the InputStream returned by OpenJPA in a java.io.BufferedInputStream or PushbackInputStream
and then using the methods Mike has mentioned.

Greetings,
Milosz

> What about using InputStream.mark() and .reset()?
> 
> The unit test for OpenJPA's streaming lob support uses a
> ByteArrayInputStream and a quick sniff test with mark and reset worked for
> me.
> 
> -mike
> 
> On Thu, Nov 18, 2010 at 1:20 PM, Norman Maurer <norman@apache.org> wrote:
> 
> >
> > We use openjpa for an imap mail store in JAMES. Sometimes we need to read
> > the
> > InputStream a few times and would like to save the cost of query again
> > every
> > time.
> >
> > For example we read the stream for analyze the message and then again for
> > write it back the the imap client.
> >
> > Bye,
> > Norman
> > --
> > View this message in context:
> > http://openjpa.208410.n2.nabble.com/Possible-to-re-read-InputStream-when-using-LOB-Streaming-tp5752905p5752968.html
> > Sent from the OpenJPA Users mailing list archive at Nabble.com.
> >
> 

Mime
View raw message