src/windows/native/java/io/io_util_md.c

Print this page

        

@@ -476,11 +476,11 @@
     if (SetEndOfFile(h) == FALSE) return -1;
     return 0;
 }
 
 JNIEXPORT
-size_t
+jint
 handleRead(jlong fd, void *buf, jint len)
 {
     DWORD read = 0;
     BOOL result = 0;
     HANDLE h = (HANDLE)fd;

@@ -497,14 +497,14 @@
         if (error == ERROR_BROKEN_PIPE) {
             return 0; /* EOF */
         }
         return -1;
     }
-    return read;
+    return (jint)read;
 }
 
-static size_t writeInternal(jlong fd, const void *buf, jint len, jboolean append)
+static jint writeInternal(jlong fd, const void *buf, jint len, jboolean append)
 {
     BOOL result = 0;
     DWORD written = 0;
     HANDLE h = (HANDLE)fd;
     if (h != INVALID_HANDLE_VALUE) {

@@ -525,20 +525,20 @@
                            lpOv);            /* overlapped struct */
     }
     if ((h == INVALID_HANDLE_VALUE) || (result == 0)) {
         return -1;
     }
-    return (size_t)written;
+    return (jint)written;
 }
 
 JNIEXPORT
-size_t handleWrite(jlong fd, const void *buf, jint len) {
+jint handleWrite(jlong fd, const void *buf, jint len) {
     return writeInternal(fd, buf, len, JNI_FALSE);
 }
 
 JNIEXPORT
-size_t handleAppend(jlong fd, const void *buf, jint len) {
+jint handleAppend(jlong fd, const void *buf, jint len) {
     return writeInternal(fd, buf, len, JNI_TRUE);
 }
 
 jint
 handleClose(JNIEnv *env, jobject this, jfieldID fid)