sudipta1411 / jtar

Automatically exported from code.google.com/p/jtar
0 stars 0 forks source link

Use actual 'skip' in the 'skip' implementation #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In revision 27, the implementation of 'skip' has been changed, and uses the 
'read' function of the underlying input stream, instead of its 'skip'.
That means that in order to get to a certain entry, all previous entries should 
be read, rather then skipped, which means a huge performance problem.
For large files it's a serious issue, which needs to be changed (even only for 
supporting input streams).

Original issue reported on code.google.com by itaig...@gmail.com on 5 Dec 2011 at 5:00

GoogleCodeExporter commented 9 years ago
The default implementation of "skip" also uses the "read" function to skip the 
bytes. I have seen other implementations of skip, like Apache's IOUtils.skip, 
which uses the same approach. The reason why the method was overridden was to 
provide "skip" functionality to derived InputStream classes that don't support 
the "skip" method, which was causing an issue while reading tar files. I'll see 
if I find more efficient ways to skip bytes.

Original comment by xeus....@gmail.com on 7 Dec 2011 at 2:05

GoogleCodeExporter commented 9 years ago
Is it possible to add this feature as a parameter to the package?
Meaning, to select weather to use 'skip' implementation or 'read'?

Original comment by itaig...@gmail.com on 7 Dec 2011 at 2:55

GoogleCodeExporter commented 9 years ago
Yes this can be done, I will add it in the next release.

Original comment by xeus....@gmail.com on 8 Dec 2011 at 9:05

GoogleCodeExporter commented 9 years ago
v1.1

Original comment by xeus....@gmail.com on 1 May 2012 at 9:14