package org.webbitserver.netty.contrib;

import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.util.CharsetUtil;

import static org.jboss.netty.buffer.ChannelBuffers.copiedBuffer;

public class DefaultEventSourceFrame {
    private final String message;

    public DefaultEventSourceFrame(String message) {
        this.message = message;
    }

    public ChannelBuffer toChannelBuffer() {
        return copiedBuffer("data:" + message + "\n\n", CharsetUtil.UTF_8);
    }
}

@@ -427,16 +427,115 @@
 dBuffer(
+toString(), CharsetUtil.UTF_8);%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        return 
 %22data:%22 
@@ -552,36 +552,16 @@
 + %22%5Cn%5Cn%22
-, CharsetUtil.UTF_8)
 ;%0A    %7D%0A

Fix failing test