File tree Expand file tree Collapse file tree
src/test/java/org/apache/commons/codec/binary Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717
1818package org .apache .commons .codec .binary ;
1919
20- import java .io .ByteArrayOutputStream ;
2120import java .io .IOException ;
2221import java .io .InputStream ;
2322import java .util .Random ;
2423
24+ import org .apache .commons .io .IOUtils ;
25+
2526/**
2627 * Data and functions common to BaseN tests.
2728 */
@@ -140,13 +141,7 @@ private static byte[] resizeArray(final byte[] bytes) {
140141 * @throws IOException if an error occurs whilst reading the input stream
141142 */
142143 static byte [] streamToBytes (final InputStream in ) throws IOException {
143- final ByteArrayOutputStream os = new ByteArrayOutputStream ();
144- final byte [] buf = new byte [4096 ];
145- int read ;
146- while ((read = in .read (buf )) > -1 ) {
147- os .write (buf , 0 , read );
148- }
149- return os .toByteArray ();
144+ return IOUtils .toByteArray (in );
150145 }
151146
152147 /**
You can’t perform that action at this time.
0 commit comments