--- a/src/java.base/share/classes/sun/nio/ch/IOStatus.java Fri Mar 22 13:42:45 2019 +0530
+++ b/src/java.base/share/classes/sun/nio/ch/IOStatus.java Fri Mar 22 11:35:35 2019 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -81,4 +81,12 @@
return ((n > EOF) || (n < UNSUPPORTED_CASE));
}
+ /**
+ * Returns true if the error code is UNAVAILABLE or INTERRUPTED, the
+ * error codes to indicate that an I/O operation can be retried.
+ */
+ static boolean okayToRetry(long n) {
+ return (n == IOStatus.UNAVAILABLE) || (n == IOStatus.INTERRUPTED);
+ }
+
}