package rabbit.httpio;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.Selector;
import java.nio.channels.SocketChannel;
import rabbit.io.BufferHandle;
import rabbit.io.SimpleBufferHandle;
import rabbit.util.Logger;
import rabbit.util.TrafficLogger;

/** A class that sends the chunk ending (with an empty footer).
 *
 * @author <a href="mailto:robo@khelekore.org">Robert Olofsson</a>
 */
public class ChunkEnder {
    private static final byte[] CHUNK_ENDING = 
    new byte[] {'0', '\r', '\n', '\r', '\n'};

    public void sendChunkEnding (SocketChannel channel, Selector selector, 
				 Logger logger, TrafficLogger tl, 
				 BlockSentListener bsl) 
	throws IOException {
	ByteBuffer bb = ByteBuffer.wrap (CHUNK_ENDING);
	BufferHandle bh = new SimpleBufferHandle (bb);
	new BlockSender (channel, selector, logger, tl, bh, false, bsl);
    }
}

@@ -77,43 +77,8 @@
 er;%0A
-import java.nio.channels.Selector;%0A
 impo
@@ -113,16 +113,16 @@
 hannel;%0A
+
 import r
@@ -199,17 +199,20 @@
 bit.
-util.Logg
+nio.NioHandl
 er;%0A
@@ -565,47 +565,35 @@
 el, 
-Selector selecto
+NioHandler nioHandle
 r,
- 
 %0A%09%09%09%09
- Logger logger,
  Tra
@@ -607,22 +607,16 @@
 ger tl, 
-%0A%09%09%09%09 
 BlockSen
@@ -781,22 +781,16 @@
 el, 
-selector, logg
+nioHandl
 er, 

Convert to NioHandler usage.