Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1836#discussion_r16006660
  
    --- Diff: 
core/src/main/scala/org/apache/spark/broadcast/TorrentBroadcast.scala ---
    @@ -264,7 +279,19 @@ private[broadcast] object TorrentBroadcast extends 
Logging {
           System.arraycopy(arrayOfBlocks(i).byteArray, 0, retByteArray,
             i * BLOCK_SIZE, arrayOfBlocks(i).byteArray.length)
         }
    -    Utils.deserialize[T](retByteArray, 
Thread.currentThread.getContextClassLoader)
    +
    +    val in: InputStream = {
    --- End diff --
    
    can we rewrite this as
    ```scala
    val in: InputStream = {
      val istream = new ByteArrayInputStream(retByteArray)
      if (compress) compressionCodec.compressedInputStream(istream) else istream
    }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to