通道之间传输数据
transferFrom()
transferTo()
@Test
public void test3() throws IOException {
FileChannel inChannel = FileChannel.open(Paths.get("1.png"), StandardOpenOption.READ);
FileChannel outChannel = FileChannel.open(Paths.get("4.png"),StandardOpenOption.READ,StandardOpenOption.WRITE,StandardOpenOption.CREATE); inChannel.transferTo(0, inChannel.size(), outChannel); outChannel.close();
inChannel.close();
}