Re: [compress][io] Avoid InputStream#skip?

2018-05-01 Thread Matt Sicker
Speaking of rarely used APIs in java.io, would that also include mark/available/reset? Or are those all implemented in terms of skip()? On 1 May 2018 at 06:05, Torsten Curdt wrote: > +1 > > On Tue, May 1, 2018 at 12:59 PM, sebb wrote: > > > On 1 May 2018 at

Re: [compress][io] Avoid InputStream#skip?

2018-05-01 Thread Torsten Curdt
+1 On Tue, May 1, 2018 at 12:59 PM, sebb wrote: > On 1 May 2018 at 11:24, Stefan Bodewig wrote: > > Hi all > > > > as skip throwing exception is uncommon enough that it hasn't been > > reported before in Compress and only seems to happen if you use streams

Re: [compress][io] Avoid InputStream#skip?

2018-05-01 Thread sebb
On 1 May 2018 at 11:24, Stefan Bodewig wrote: > Hi all > > as skip throwing exception is uncommon enough that it hasn't been > reported before in Compress and only seems to happen if you use streams > like System.in maybe we can solve the issue by providing a wrapper > stream

Re: [compress][io] Avoid InputStream#skip?

2018-05-01 Thread Stefan Bodewig
Hi all as skip throwing exception is uncommon enough that it hasn't been reported before in Compress and only seems to happen if you use streams like System.in maybe we can solve the issue by providing a wrapper stream that overrides skip so that it uses read and advice people to use that if they

Re: [compress][io] Avoid InputStream#skip?

2018-04-25 Thread Stefan Bodewig
On 2018-04-23, sebb wrote: > On 23 April 2018 at 19:45, Stefan Bodewig wrote: >> On 2018-04-22, Gary Gregory wrote: >>> We should at the very least document all of this carefully. >> commons-io's IOUtils already quite clearly states it is using read and >> not using skip at

Re: [compress][io] Avoid InputStream#skip?

2018-04-23 Thread sebb
On 23 April 2018 at 19:45, Stefan Bodewig wrote: > On 2018-04-22, Gary Gregory wrote: > >> We should at the very least document all of this carefully. > > commons-io's IOUtils already quite clearly states it is using read and > not using skip at all. > >> My gut reaction is

Re: [compress][io] Avoid InputStream#skip?

2018-04-23 Thread Stefan Bodewig
On 2018-04-22, Gary Gregory wrote: > We should at the very least document all of this carefully. commons-io's IOUtils already quite clearly states it is using read and not using skip at all. > My gut reaction is that an API called skip should call skip internally. > Doing anything else clever

Re: [compress][io] Avoid InputStream#skip?

2018-04-22 Thread Gary Gregory
Hi All: We should at the very least document all of this carefully. My gut reaction is that an API called skip should call skip internally. Doing anything else clever as you point out has performance implications and might violate the principle of least surprise. We could consider creating a

[compress][io] Avoid InputStream#skip?

2018-04-22 Thread Stefan Bodewig
Hi all while looking into https://issues.apache.org/jira/browse/COMPRESS-449 I realized that calling skip on any InputStream probably means you are up to receiving an IOException because some stream in there decided to implement skip via seek and now faces a stream that doesn't support seek. And