wagon-provider-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java [500:524]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            if (read == -1) {
                // EOF, but some data has not been written yet.
                if (((Buffer) buffer).position() != 0) {
                    ((Buffer) buffer).flip();
                    fireTransferProgress(transferEvent, buffer.array(), ((Buffer) buffer).limit());
                    output.write(buffer.array(), 0, ((Buffer) buffer).limit());
                    ((Buffer) buffer).clear();
                }

                break;
            }

            // Prevent minichunking/fragmentation: when less than half the buffer is utilized,
            // read some more bytes before writing and firing progress.
            if (((Buffer) buffer).position() < halfBufferCapacity) {
                continue;
            }

            ((Buffer) buffer).flip();
            fireTransferProgress(transferEvent, buffer.array(), ((Buffer) buffer).limit());
            output.write(buffer.array(), 0, ((Buffer) buffer).limit());
            remaining -= ((Buffer) buffer).limit();
            ((Buffer) buffer).clear();
        }
        output.flush();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



wagon-providers/wagon-http-shared/src/main/java/org/apache/maven/wagon/shared/http/AbstractHttpClientWagon.java [191:215]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                    if (read == -1) {
                        // EOF, but some data has not been written yet.
                        if (((Buffer) buffer).position() != 0) {
                            ((Buffer) buffer).flip();
                            fireTransferProgress(transferEvent, buffer.array(), ((Buffer) buffer).limit());
                            output.write(buffer.array(), 0, ((Buffer) buffer).limit());
                            ((Buffer) buffer).clear();
                        }

                        break;
                    }

                    // Prevent minichunking/fragmentation: when less than half the buffer is utilized,
                    // read some more bytes before writing and firing progress.
                    if (((Buffer) buffer).position() < halfBufferCapacity) {
                        continue;
                    }

                    ((Buffer) buffer).flip();
                    fireTransferProgress(transferEvent, buffer.array(), ((Buffer) buffer).limit());
                    output.write(buffer.array(), 0, ((Buffer) buffer).limit());
                    remaining -= ((Buffer) buffer).limit();
                    ((Buffer) buffer).clear();
                }
                output.flush();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



