src/share/native/java/io/io_util.c

Print this page

        

*** 42,52 **** FD fd = GET_FD(this, fid); if (fd == -1) { JNU_ThrowIOException(env, "Stream Closed"); return -1; } ! nread = (jint)IO_Read(fd, &ret, 1); if (nread == 0) { /* EOF */ return -1; } else if (nread == JVM_IO_ERR) { /* error */ JNU_ThrowIOExceptionWithLastError(env, "Read error"); } else if (nread == JVM_IO_INTR) { --- 42,52 ---- FD fd = GET_FD(this, fid); if (fd == -1) { JNU_ThrowIOException(env, "Stream Closed"); return -1; } ! nread = IO_Read(fd, &ret, 1); if (nread == 0) { /* EOF */ return -1; } else if (nread == JVM_IO_ERR) { /* error */ JNU_ThrowIOExceptionWithLastError(env, "Read error"); } else if (nread == JVM_IO_INTR) {
*** 106,116 **** fd = GET_FD(this, fid); if (fd == -1) { JNU_ThrowIOException(env, "Stream Closed"); nread = -1; } else { ! nread = (jint)IO_Read(fd, buf, len); if (nread > 0) { (*env)->SetByteArrayRegion(env, bytes, off, nread, (jbyte *)buf); } else if (nread == JVM_IO_ERR) { JNU_ThrowIOExceptionWithLastError(env, "Read error"); } else if (nread == JVM_IO_INTR) { --- 106,116 ---- fd = GET_FD(this, fid); if (fd == -1) { JNU_ThrowIOException(env, "Stream Closed"); nread = -1; } else { ! nread = IO_Read(fd, buf, len); if (nread > 0) { (*env)->SetByteArrayRegion(env, bytes, off, nread, (jbyte *)buf); } else if (nread == JVM_IO_ERR) { JNU_ThrowIOExceptionWithLastError(env, "Read error"); } else if (nread == JVM_IO_INTR) {
*** 135,147 **** if (fd == -1) { JNU_ThrowIOException(env, "Stream Closed"); return; } if (append == JNI_TRUE) { ! n = (jint)IO_Append(fd, &c, 1); } else { ! n = (jint)IO_Write(fd, &c, 1); } if (n == JVM_IO_ERR) { JNU_ThrowIOExceptionWithLastError(env, "Write error"); } else if (n == JVM_IO_INTR) { JNU_ThrowByName(env, "java/io/InterruptedIOException", NULL); --- 135,147 ---- if (fd == -1) { JNU_ThrowIOException(env, "Stream Closed"); return; } if (append == JNI_TRUE) { ! n = IO_Append(fd, &c, 1); } else { ! n = IO_Write(fd, &c, 1); } if (n == JVM_IO_ERR) { JNU_ThrowIOExceptionWithLastError(env, "Write error"); } else if (n == JVM_IO_INTR) { JNU_ThrowByName(env, "java/io/InterruptedIOException", NULL);
*** 188,200 **** if (fd == -1) { JNU_ThrowIOException(env, "Stream Closed"); break; } if (append == JNI_TRUE) { ! n = (jint)IO_Append(fd, buf+off, len); } else { ! n = (jint)IO_Write(fd, buf+off, len); } if (n == JVM_IO_ERR) { JNU_ThrowIOExceptionWithLastError(env, "Write error"); break; } else if (n == JVM_IO_INTR) { --- 188,200 ---- if (fd == -1) { JNU_ThrowIOException(env, "Stream Closed"); break; } if (append == JNI_TRUE) { ! n = IO_Append(fd, buf+off, len); } else { ! n = IO_Write(fd, buf+off, len); } if (n == JVM_IO_ERR) { JNU_ThrowIOExceptionWithLastError(env, "Write error"); break; } else if (n == JVM_IO_INTR) {