You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Travis Reeder <tr...@gmail.com> on 2007/09/11 01:11:48 UTC

[Commons IO] File splitting and joining

I am looking for a file splitter and joiner and naturally looked at
commons-io to see if it had it, but it doesn't look like it does. Would it
make sense to add it to FileUtils or something?  Should be somewhat simple
to implement.

Travis

RE: [Commons IO] File splitting and joining

Posted by Jörg Schaible <Jo...@Elsag-Solutions.com>.
Henri Yandell wrote on Thursday, September 13, 2007 6:50 PM:

> Or maybe for the join it's a IOUtils.copy(InputStream[],
> OutputStream) and Reader[] overload. 

Hmmm. The JDK already comes with the widely unknown SequenceInputStream. However, an overloaded cop method has something appealing ;-)

[snip]

- Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Commons IO] File splitting and joining

Posted by Travis Reeder <tr...@gmail.com>.
Henri,

The copy() method sounds good.

For split, maybe something like: split(File and/or InputStream, long
bytesPerChunk, NamingScheme);

Where NamingScheme is an interface that would define how the chunks should
be named, for example, an IncrementingNamingScheme would append a number to
a name for each chunk.  Same naming scheme class would be used for the
reverse process too.

Travis


On 9/13/07, Henri Yandell <fl...@gmail.com> wrote:
>
> Or maybe for the join it's a IOUtils.copy(InputStream[], OutputStream)
> and Reader[] overload.
>
> How would split look? Split on byte number for splitter and on line
> number for Reader?
>
> On 9/10/07, Travis Reeder <tr...@gmail.com> wrote:
> > I am looking for a file splitter and joiner and naturally looked at
> > commons-io to see if it had it, but it doesn't look like it does. Would
> it
> > make sense to add it to FileUtils or something?  Should be somewhat
> simple
> > to implement.
> >
> > Travis
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

Re: [Commons IO] File splitting and joining

Posted by Henri Yandell <fl...@gmail.com>.
Or maybe for the join it's a IOUtils.copy(InputStream[], OutputStream)
and Reader[] overload.

How would split look? Split on byte number for splitter and on line
number for Reader?

On 9/10/07, Travis Reeder <tr...@gmail.com> wrote:
> I am looking for a file splitter and joiner and naturally looked at
> commons-io to see if it had it, but it doesn't look like it does. Would it
> make sense to add it to FileUtils or something?  Should be somewhat simple
> to implement.
>
> Travis
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org