On 2009-03-28, sebb <seb...@gmail.com> wrote: >>> <p>Reading entries from an ar archive:</p> >>> <source><![CDATA[ >>> ArArchiveEntry entry = (ArArchiveEntry) arInput.getNextEntry(); >>> byte[] content = new byte[entry.getSize()]; >>> LOOP UNTIL entry.getSize() HAS BEEN READ {
> I thought the idea was that the ArchiveInputStreams would not allow > one to read past the end of the entry, so one can just read until > read() returns -1? I wrote that on the train last night while I was offline and committed it this afternoon before reading my mail 8-) I don't think AR is the only archiver that does not return -1 once you read past the end of the current entry, nor am I convinced that it is a good idea to expect the streams to do so. The code of the examples should work and IMHO the API user should rather rely on the entry's size than on the stream returning -1. Are we sure our streams return -1 on directory entries immediately? BTW, while catching up with mail I saw a lot of discussion going on inside JIRA instead of on the dev list. This may be a project cultural thing, but to me JIRA is not the correct place for that. Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org