yangxu998 / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

CapturingInputStream #594

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This abstract class provides a generic way (as opposed to some 'TeeInputStream' 
implementations that specifically use an OutputStream) to consume and process 
an arbitrary slice of an InputStream while the data is in flight. It inherits 
from ConsumingInputStream in issue 593, and turns off/on the consuming aspect 
only as needed to grab the desired slice of data.

Original issue reported on code.google.com by tv@duh.org on 5 Apr 2011 at 8:29

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by tv@duh.org on 5 Apr 2011 at 8:29

Attachments:

GoogleCodeExporter commented 9 years ago
Just noticed a bug in skip(); the return value can be wrong. This:

            // count == start at this point. Start consuming.
            setConsuming(true);
            n -= wasSkipped;
        }

should be this:

            // count == start at this point. Start consuming.
            setConsuming(true);
            return wasSkipped + super.skip(n - wasSkipped);
        }

Original comment by tv@duh.org on 6 Apr 2011 at 12:40

GoogleCodeExporter commented 9 years ago
Afterthought: This could be trivially reworked to be non-abstract and use a 
ByteProcessor as the data processing engine, if that's more desirable.

Original comment by tv@duh.org on 6 Apr 2011 at 2:59

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 13 Jul 2011 at 7:36

GoogleCodeExporter commented 9 years ago

Original comment by cpov...@google.com on 13 Jul 2011 at 7:43

GoogleCodeExporter commented 9 years ago

Original comment by fry@google.com on 10 Dec 2011 at 4:05

GoogleCodeExporter commented 9 years ago

Original comment by fry@google.com on 16 Feb 2012 at 7:17

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 30 May 2012 at 7:43

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 22 Jun 2012 at 6:16

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:15

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:18

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:09