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

    https://github.com/apache/spark/pull/2969#discussion_r19454354
  
    --- Diff: core/src/main/scala/org/apache/spark/network/ManagedBuffer.scala 
---
    @@ -106,7 +112,7 @@ final class FileSegmentManagedBuffer(val file: File, 
val offset: Long, val lengt
         var is: FileInputStream = null
         try {
           is = new FileInputStream(file)
    -      is.skip(offset)
    --- End diff --
    
    
http://docs.oracle.com/javase/7/docs/api/java/io/FileInputStream.html#skip(long):
    
    > Skips over and discards n bytes of data from the input stream.
    >
    > The skip method may, for a variety of reasons, end up skipping over some 
smaller number of bytes, possibly 0. If n is negative, an IOException is 
thrown, even though the skip method of the InputStream superclass does nothing 
in this case. The actual number of bytes skipped is returned.
    >
    > This method may skip more bytes than are remaining in the backing file. 
This produces no exception and the number of bytes skipped may include some 
number of bytes that were beyond the EOF of the backing file. Attempting to 
read from the stream after skipping past the end will result in -1 indicating 
the end of the file.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to