commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thufir <>
Subject uses; reading a live InputStream
Date Sat, 31 Aug 2013 03:15:26 GMT
I'm trying to figure out ho

uses and how to use that API.  Can I use


     public static final long copyStream(InputStream source,
                   OutputStream dest)
                                  throws CopyStreamException

     Same as copyStream(source, dest, DEFAULT_COPY_BUFFER_SIZE);


in order to capture the stream *as it comes in* through

I see how the demo reads and writes to the console concurrently (well, 
with threads, so that it appears concurrent).  How can I emulate that so 
that, while that's going, a log file is being written to so that if the 
stream closes suddenly, or the application crashes, the log file is there.

This is for a MUD (game) client, in order to parse the stream *live*.  
If it's a file, and you wait until EOF, that's easy enough.  But how do 
you read the data *live* in such a way that it can be processed?



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message