Created
June 4, 2015 12:28
-
-
Save epickrram/e299bf98de9375a01e40 to your computer and use it in GitHub Desktop.
RandomAccessFile.seek0()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
From http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/native/java/io/RandomAccessFile.c#l126 | |
*/ | |
Java_java_io_RandomAccessFile_seek0(JNIEnv *env, | |
jobject this, jlong pos) { | |
FD fd; | |
fd = GET_FD(this, raf_fd); | |
if (fd == -1) { | |
JNU_ThrowIOException(env, "Stream Closed"); | |
return; | |
} | |
if (pos < jlong_zero) { | |
JNU_ThrowIOException(env, "Negative seek offset"); | |
} else if (IO_Lseek(fd, pos, SEEK_SET) == -1) { | |
JNU_ThrowIOExceptionWithLastError(env, "Seek failed"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment