Skip to content

Commit b0ee6e2

Browse files
committed
Added buffering
1 parent 5de7b05 commit b0ee6e2

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<dependency>
5656
<groupId>org.codehaus.plexus</groupId>
5757
<artifactId>plexus-io</artifactId>
58-
<version>2.0.7</version>
58+
<version>2.0.8</version>
5959
</dependency>
6060
<dependency>
6161
<groupId>org.apache.commons</groupId>

src/main/java/org/codehaus/plexus/archiver/jar/JarArchiver.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* limitations under the License.
1818
*/
1919

20+
import java.io.BufferedOutputStream;
2021
import java.io.ByteArrayInputStream;
2122
import java.io.ByteArrayOutputStream;
2223
import java.io.File;
@@ -537,7 +538,8 @@ protected boolean createEmptyZip( File zipFile )
537538
try
538539
{
539540
getLogger().debug( "Building MANIFEST-only jar: " + getDestFile().getAbsolutePath() );
540-
zOut = new ZipOutputStream( new FileOutputStream( getDestFile() ) );
541+
FileOutputStream out = new FileOutputStream( getDestFile() );
542+
zOut = new ZipOutputStream( new BufferedOutputStream( out, 65536) );
541543

542544
zOut.setEncoding( getEncoding() );
543545
if ( isCompress() )

src/main/java/org/codehaus/plexus/archiver/zip/AbstractZipArchiver.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* limitations under the License.
1818
*/
1919

20+
import java.io.BufferedOutputStream;
2021
import java.io.ByteArrayOutputStream;
2122
import java.io.File;
2223
import java.io.FileOutputStream;
@@ -305,7 +306,9 @@ private void createArchiveMain()
305306

306307
if ( !skipWriting )
307308
{
308-
zOut = new ZipOutputStream( zipFile );
309+
FileOutputStream out = new FileOutputStream( zipFile );
310+
BufferedOutputStream buffered = new BufferedOutputStream( out, 65536 );
311+
zOut = new ZipOutputStream( buffered );
309312

310313
zOut.setEncoding( encoding );
311314
if ( doCompress )

0 commit comments

Comments
 (0)