srowen commented on a change in pull request #35622:
URL: https://github.com/apache/spark/pull/35622#discussion_r813046220



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/package.scala
##########
@@ -100,6 +70,23 @@ package object util extends Logging {
     file
   }
 
+  private def toByteArray(inStream: InputStream): Array[Byte] = {
+    val outStream = new ByteArrayOutputStream
+    try {
+      var reading = true
+      while (reading) {
+        inStream.read() match {

Review comment:
       Ah true; that implementation is still better as it copies whole buffers 
at a time. I think it's preferable to use, also for simplicity.




-- 
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