package fr.upem.tcp;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;

public class ClientBizarre {

	public static void main(String[] args) throws IOException, InterruptedException {

		SocketChannel s = SocketChannel.open(new InetSocketAddress("localhost",7777));
		Charset utf8 = Charset.forName("UTF-8");
		ByteBuffer bb = utf8.encode("abc€def€");
		bb.limit(5);
		s.write(bb);
		Thread.sleep(100);
		bb.limit(11);
		s.write(bb);
		s.close();
	}

}
