Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Non-blocking I/O (Java)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==JDK 7 and NIO.2== {{Anchor|NIO.2}} {{Expand section|date=December 2009}} JDK 7 includes a {{Javadoc:SE|package=java.nio.file|java/nio/file}} package which, with the {{Javadoc:SE|java/nio/file|Path}} class (also new to JDK 7), among other features, provides extended capabilities for filesystem tasks, e.g. can work with [[Symbolic link|symbolic]]/[[Hard link|hard]] links and dump big directory listings into buffers more quickly than the old File class does. The {{Javadoc:SE|package=java.nio.file|java/nio/file}} package and its related package, {{Javadoc:SE|package=java.nio.file.attribute|java/nio/file/attribute}}, provide comprehensive support for file I/O and for accessing the file system. A zip file system provider is also available in JDK 7. The <code>java.nio.file.LinkOption</code> is an example of emulating extensible enums with interfaces.{{sfn|Bloch|2018|loc=Chapter Β§6 Item 38 Emulate extensible enums with interfaces|pp=176-179}} In Java, it is not possible to have one <code>Enum</code> extend another <code>Enum</code>. However, it is possible to emulate an extensible <code>Enum</code> type by having an <code>Enum</code> implement one or more interfaces. <code>LinkOption</code> is an enum type that implements both the <code>OpenOption</code> and <code>CopyOption</code> interfaces, which emulates the effects of an extensible <code>Enum</code> type. A small down-side to this approach is that implementations cannot be inherited between various <code>Enum</code> types. {{sfn|Bloch|2018|loc=Chapter Β§6 Item 38 Emulate extensible enums with interfaces|pp=176-179}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)