0gam
NIO(NonblockingIO) 본문
Non-blocking I/O (Java)
From Wikipedia, the free encyclopedia
Non-blocking I/O (usually called NIO, and sometimes called "New I/O") is a collection of Java programming language APIs that offer features for intensive I/O operations. It was introduced with the J2SE 1.4 release of Java by Sun Microsystems to complement an existing standard I/O. NIO was developed under the Java Community Process as JSR 51.[1] An extension to NIO that offers a new file system API, called NIO.2, was released with Java SE 7 ("Dolphin").[2]
// Getting file channels
FileChannel in = new FileInputStream(source).getChannel();
FileChannel out = new FileOutputStream(target).getChannel();
// JavaVM does its best to do this as native I/O operations.
in.transferTo(0, in.size(), out);
// Closing file channels will close corresponding stream objects as well.
out.close();
in.close();
'Java' 카테고리의 다른 글
Java 8 Stream (0) | 2018.05.23 |
---|---|
Features of Java (0) | 2017.03.16 |
History of Java (0) | 2017.03.16 |
Difference between Java Heap Space and Stack Memory (0) | 2017.03.15 |
Thread.ExecutorService (0) | 2016.10.22 |