[GitHub] [commons-compress] matthijsln edited a comment on pull request #214: [COMPRESS-584] Fix IOUtils.readRange() can read more from a channel than asked for

2021-08-05 Thread GitBox
matthijsln edited a comment on pull request #214: URL: https://github.com/apache/commons-compress/pull/214#issuecomment-892573540 The "no copy buffer" version can be more efficient by only calling `Arrays.copyOf()` when hitting EOF. This avoids copying the byte array when it is completely

[GitHub] [commons-compress] matthijsln edited a comment on pull request #214: [COMPRESS-584] Fix IOUtils.readRange() can read more from a channel than asked for

2021-08-04 Thread GitBox
matthijsln edited a comment on pull request #214: URL: https://github.com/apache/commons-compress/pull/214#issuecomment-892573540 The "no copy buffer" version can be more efficient by only calling `Arrays.copyOf()` when hitting EOF. This avoids copying the byte array when it is completely

[GitHub] [commons-compress] matthijsln edited a comment on pull request #214: [COMPRESS-584] Fix IOUtils.readRange() can read more from a channel than asked for

2021-08-04 Thread GitBox
matthijsln edited a comment on pull request #214: URL: https://github.com/apache/commons-compress/pull/214#issuecomment-892504852 This would work without a copy buffer: ``` public static byte[] readRange(final ReadableByteChannel input, final int len) throws IOException {

[GitHub] [commons-compress] matthijsln edited a comment on pull request #214: [COMPRESS-584] Fix IOUtils.readRange() can read more from a channel than asked for

2021-08-04 Thread GitBox
matthijsln edited a comment on pull request #214: URL: https://github.com/apache/commons-compress/pull/214#issuecomment-892504852 This would work without a copy buffer: ``` public static byte[] readRange(final ReadableByteChannel input, final int len) throws IOException {

[GitHub] [commons-compress] matthijsln edited a comment on pull request #214: [COMPRESS-584] Fix IOUtils.readRange() can read more from a channel than asked for

2021-08-04 Thread GitBox
matthijsln edited a comment on pull request #214: URL: https://github.com/apache/commons-compress/pull/214#issuecomment-892504852 This would work without a copy buffer: ``` public static byte[] readRange(final ReadableByteChannel input, final int len) throws IOException {

[GitHub] [commons-compress] matthijsln edited a comment on pull request #214: [COMPRESS-584] Fix IOUtils.readRange() can read more from a channel than asked for

2021-08-04 Thread GitBox
matthijsln edited a comment on pull request #214: URL: https://github.com/apache/commons-compress/pull/214#issuecomment-892504852 This would work without a copy buffer: ``` public static byte[] readRange(final ReadableByteChannel input, final int len) throws IOException {

[GitHub] [commons-compress] matthijsln edited a comment on pull request #214: [COMPRESS-584] Fix IOUtils.readRange() can read more from a channel than asked for

2021-08-04 Thread GitBox
matthijsln edited a comment on pull request #214: URL: https://github.com/apache/commons-compress/pull/214#issuecomment-892469732 > Hi @matthijsln > Please have a look at my reply :-) > > > When the len of bytes to read is bigger than COPY_BUF_SIZE, there are some problems. You ca

[GitHub] [commons-compress] matthijsln edited a comment on pull request #214: [COMPRESS-584] Fix IOUtils.readRange() can read more from a channel than asked for

2021-08-04 Thread GitBox
matthijsln edited a comment on pull request #214: URL: https://github.com/apache/commons-compress/pull/214#issuecomment-892469732 > Hi @matthijsln > Please have a look at my reply :-) > > > When the len of bytes to read is bigger than COPY_BUF_SIZE, there are some problems. You ca

[GitHub] [commons-compress] matthijsln edited a comment on pull request #214: [COMPRESS-584] Fix IOUtils.readRange() can read more from a channel than asked for

2021-08-04 Thread GitBox
matthijsln edited a comment on pull request #214: URL: https://github.com/apache/commons-compress/pull/214#issuecomment-892469732 > Hi @matthijsln > Please have a look at my reply :-) > > > When the len of bytes to read is bigger than COPY_BUF_SIZE, there are some problems. You ca

[GitHub] [commons-compress] matthijsln edited a comment on pull request #214: [COMPRESS-584] Fix IOUtils.readRange() can read more from a channel than asked for

2021-08-04 Thread GitBox
matthijsln edited a comment on pull request #214: URL: https://github.com/apache/commons-compress/pull/214#issuecomment-892469732 > Hi @matthijsln > Please have a look at my reply :-) > > > When the len of bytes to read is bigger than COPY_BUF_SIZE, there are some problems. You ca