摘要:
public class NIOClient { static int SIZE = 2; final static int bufferSize = 500 * 1024; static InetSocketAddress ip = new InetSocketAddress("localhost", 12345); static CharsetEncoder encoder = Charset.forName("GB2312").newEncoder(); static class Download implements Runnable { p.. 阅读全文
摘要:
package org.fxc.nio.server;import java.io.FileInputStream;import java.io.IOException;import java.net.InetSocketAddress;import java.nio.ByteBuffer;import java.nio.CharBuffer;import java.nio.channels.FileChannel;import java.nio.channels.SelectionKey;import java.nio.channels.Selector;import java.nio.ch 阅读全文