摘要: 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.. 阅读全文
posted @ 2013-07-20 00:18 傅心词 阅读(440) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2013-07-20 00:18 傅心词 阅读(561) 评论(0) 推荐(0) 编辑