channel
1)通道基础 通道(Channel)是java.nio的第二个主要创新。它们既不是一个扩展也不是一项增强,而是全新、极好的Java I/O示例,提供与I/O服务的直接连接。Channel用于在字节缓冲区和位于通道另一侧的实体(通常是一个文件或套接字)之间有效地传输数据。 channel的jdk源码:123456package java.nio.channels; public interface Channel; { public boolean isOpen(); public void close() throws IOException; } 与缓冲区不同,通道API主要由接口指定。不同的操作系统上通道实现(Channel Implementation)会有根本性的差异,所以通道API仅仅描述了可以做什么。因此很自然地,通道实现经常使用操作系统的本地代码。通道接口允许您以一种受控且可移植的方式来访问底层的I/O服务。Channel是一个对象,可以通过它读取和写入数据。拿 NIO 与原来的 I/O 做个比较,通道就像是流。所有数据都通过 Buffer 对象来处理。您永远不会将字节直接写入通道中,相反,您是将数据写入包含一个或者多个字节的缓冲区。同样,您不会直接从通道中读取字节,而是将数据从通道读入缓冲区,再从缓冲区获取这个字节。
U2FsdGVkX19WLN/50KehXZKtN6AaAH78uN2Acjorobetpj/wE3lWLB8Ohf/mATc9
3mLaCnC75ipoes5aYW1OepmGH2AckYw1lXvb5Rxy6vjjtEg8gX6iCpsd1bLyI9G2
/CGomHYcw0LGZrE1IvC1bk1haNdhoM04pgSIE9qKMYemr1VFqwwLmQJ4fsx84+wA
ZJIyh0SN0gX+Mrb8YHrbS5T9tD46LNG7nkJt4aOn3CofWajqgWvDFdv+dOO9j577
kXZgDquJD/TKwBIFrsaOxWH4xIwPeVttMQEmDvP371mkDJ34xkIAWgPmhOq29gUU
UhDX/iz/NF7atqcZfhiM1FBAwnXDnIdDGodxj7WAMr4U06mZTjarjTf8eR8Qy63u
pdEJnaJ39nIQHI6ZONwyp29MX5dbXIPlXdDFKvEbLG7zzxbnYonwlkkLEHljVVi3
C2zKVUDwwbPnzVfBDAOGmkz3u2Z5a/MWY7oqphuuNRTNSAj+I2IDy8c6gnPzPWvq
EnW3QegHLyMB792YP7EWlFkyKUVDxDtEYtUsgmZyzjW1wZDmWmOXQkKewR7MCPJZ
19/dttJK5B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