From 8a9396c64598c0946067805a42caaf7b4672ae27 Mon Sep 17 00:00:00 2001 From: Wenjie Guo Date: Thu, 5 Sep 2024 13:21:23 +0800 Subject: [PATCH] Add flush after copy during downloads --- .../indy/core/bind/jaxrs/util/TransferStreamingOutput.java | 1 + 1 file changed, 1 insertion(+) diff --git a/bindings/jaxrs/src/main/java/org/commonjava/indy/core/bind/jaxrs/util/TransferStreamingOutput.java b/bindings/jaxrs/src/main/java/org/commonjava/indy/core/bind/jaxrs/util/TransferStreamingOutput.java index ecc28839f0..8e409f2776 100644 --- a/bindings/jaxrs/src/main/java/org/commonjava/indy/core/bind/jaxrs/util/TransferStreamingOutput.java +++ b/bindings/jaxrs/src/main/java/org/commonjava/indy/core/bind/jaxrs/util/TransferStreamingOutput.java @@ -65,6 +65,7 @@ public void write( final OutputStream out ) { CountingOutputStream cout = new CountingOutputStream( out ); IOUtils.copy( stream, cout ); + cout.flush(); // ensure any remaining data is written to the output stream Logger logger = LoggerFactory.getLogger( getClass() ); logger.trace( "Wrote: {} bytes", cout.getByteCount() );