Notice
Recent Posts
Recent Comments
Link
«   2025/07   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Archives
Today
Total
관리 메뉴

0gam

NIO(NonblockingIO) 본문

Java

NIO(NonblockingIO)

byeon0gam 2016. 10. 22. 04:17

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