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

    https://github.com/apache/spark/pull/5400#discussion_r27923630
  
    --- Diff: 
core/src/main/scala/org/apache/spark/util/io/ByteArrayChunkOutputStream.scala 
---
    @@ -91,4 +95,41 @@ class ByteArrayChunkOutputStream(chunkSize: Int) extends 
OutputStream {
           ret
         }
       }
    +
    +  /**
    +   * get a copy of the data between the two endpoints
    +   */
    +  def slice(start: Long, until: Long): Array[Byte] = {
    +    require((until - start) < Integer.MAX_VALUE, "max slice length = 
Integer.MAX_VALUE")
    +    var chunkStart = 0L
    +    var chunkIdx = 0
    +    var foundStart = false
    +    val length = (until - start).toInt
    +    val result = new Array[Byte](length)
    +    while (!foundStart) {
    +      val nextSize = chunkStart + chunks(chunkIdx).size
    +      if (nextSize > start) {
    +        foundStart = true
    +      }
    +      else {
    --- End diff --
    
    nit: move to previous line


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