You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "BELUGA BEHR (JIRA)" <ji...@apache.org> on 2014/08/03 03:23:11 UTC

[jira] [Comment Edited] (IO-454) IOUtils.skipToEnd

    [ https://issues.apache.org/jira/browse/IO-454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14083828#comment-14083828 ] 

BELUGA BEHR edited comment on IO-454 at 8/3/14 1:22 AM:
--------------------------------------------------------

Julien,

Interesting use of NullOutputStream!  That seems like a handy trick I'll have to recall at some point.

Sebb,

This utility goes hand-in-hand with some of the stuff I've worked on in Commons Compress.  An example is the TarArchiveInputStream.  If the user calls the "getNextEntry()" method, then the stream must skip to the end of the current entry boundary.  One just wants to skip, but not actually close the stream as there may be addtional tar entries.  I have written this in TarArchiveInputStream as inputStream.skip(Long.MAX_VALUE) which assumes that a stream will never be longer than MAX_VALUE.  It would be better to just have a way to skip to the end of the boundary.

This is useful when using any kind of bounded InputStream that sits on top of another InputStream to skip to the next boundary.


was (Author: belugabehr):
Julien,

Interesting use of NullOutputStream!  That seems like a handy trick I'll have to recall at some point.

Sebb,

This utility goes hand-in-hand with some of the stuff I've worked on in Commons Compress.  An example is the TarArchiveInputStream.  If the user calls the "getNextEntry()" method, then the stream must skip to the end of the current entry boundary.  One just wants to skip, but not actually close the stream as there may be addtional tar entries.  I have written this in TarArchiveInputStream as inputStream.skip(Long.MAX_VALUE) which assumes that a stream will never be longer than MAX_VALUE.  It would be better to just have a way to skip.

This is useful when using any kind of bounded InputStream that sits on top of another InputStream to skip to the next boundary.

> IOUtils.skipToEnd
> -----------------
>
>                 Key: IO-454
>                 URL: https://issues.apache.org/jira/browse/IO-454
>             Project: Commons IO
>          Issue Type: New Feature
>          Components: Utilities
>            Reporter: BELUGA BEHR
>            Priority: Minor
>
> Hello,
> I'd like to see an IOUtils method that calls skip (or skip/read) on a stream until it returns -1.
> Thanks.



--
This message was sent by Atlassian JIRA
(v6.2#6252)