madrob commented on code in PR #2669:
URL: https://github.com/apache/solr/pull/2669#discussion_r1731569507


##########
solr/core/src/java/org/apache/solr/handler/designer/DefaultSampleDocumentsLoader.java:
##########
@@ -65,14 +64,11 @@ public class DefaultSampleDocumentsLoader implements 
SampleDocumentsLoader {
   private static final int MAX_STREAM_SIZE = (5 * 1024 * 1024);
   private static final Logger log = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
-  public static byte[] streamAsBytes(final InputStream in) throws IOException {
-    ByteArrayOutputStream baos = new ByteArrayOutputStream();
-    byte[] buf = new byte[1024];
-    int r;
+  /** Reads input completely into a byte array. Closes the stream. */

Review Comment:
   This feels super trappy to have this method close the stream and 
Utils.toByteArray leave it open, but not something we can fix here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to