// Path: src/main/java/net/pixelcop/sewer/Event.java
// public interface Event extends Writable {
// 
// }
// 
// Path: src/main/java/net/pixelcop/sewer/Sink.java
// public abstract class Sink extends Plumbing {
// 
//   private static final Logger LOG = LoggerFactory.getLogger(Sink.class);
// 
//   protected Sink subSink = null;
// 
//   /**
//    * Append an Event to the Sink
//    * @param event
//    * @throws IOException
//    */
//   public abstract void append(Event event) throws IOException;
// 
//   public void setSubSink(Sink subSink) {
//     this.subSink = subSink;
//   }
// 
//   public Sink getSubSink() {
//     return subSink;
//   }
// 
//   /**
//    * Create the SubSink, if possible
//    *
//    * @return True if a SubSink was created, false otherwise.
//    */
//   public boolean createSubSink() {
//     if (getSinkFactory() == null) {
//       return false;
//     }
// 
//     subSink = getSinkFactory().build();
//     return true;
//   }
// 
//   @Override
//   protected void finalize() throws Throwable {
//     if (getStatus() != CLOSED) {
//       try {
//         close();
//       } catch (Throwable t) {
//         LOG.warn("Caught during finalizer close(): " + t.getMessage(), t);
//         // rethrow? this should be good enough since the object was disposed of anyway
//       }
//     }
//   }
// 
// }


import java.io.BufferedOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
import net.pixelcop.sewer.Event;
import net.pixelcop.sewer.Sink;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
package net.pixelcop.sewer.sink;




public class TcpWriteableEventSink extends Sink {

  private static final Logger LOG = LoggerFactory.getLogger(TcpWriteableEventSink.class);

  private Socket socket;
  private DataOutputStream out;

  public TcpWriteableEventSink(String[] args) {
  }

  public void open() throws IOException {

    socket = new Socket("localhost", 9999);
// Path: src/main/java/net/pixelcop/sewer/Event.java
// public interface Event extends Writable {
// 
// }
// 
// Path: src/main/java/net/pixelcop/sewer/Sink.java
// public abstract class Sink extends Plumbing {
// 
//   private static final Logger LOG = LoggerFactory.getLogger(Sink.class);
// 
//   protected Sink subSink = null;
// 
//   /**
//    * Append an Event to the Sink
//    * @param event
//    * @throws IOException
//    */
//   public abstract void append(Event event) throws IOException;
// 
//   public void setSubSink(Sink subSink) {
//     this.subSink = subSink;
//   }
// 
//   public Sink getSubSink() {
//     return subSink;
//   }
// 
//   /**
//    * Create the SubSink, if possible
//    *
//    * @return True if a SubSink was created, false otherwise.
//    */
//   public boolean createSubSink() {
//     if (getSinkFactory() == null) {
//       return false;
//     }
// 
//     subSink = getSinkFactory().build();
//     return true;
//   }
// 
//   @Override
//   protected void finalize() throws Throwable {
//     if (getStatus() != CLOSED) {
//       try {
//         close();
//       } catch (Throwable t) {
//         LOG.warn("Caught during finalizer close(): " + t.getMessage(), t);
//         // rethrow? this should be good enough since the object was disposed of anyway
//       }
//     }
//   }
// 
// }


// Path: src/main/java/net/pixelcop/sewer/sink/TcpWriteableEventSink.java
import java.io.BufferedOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
import net.pixelcop.sewer.Event;
import net.pixelcop.sewer.Sink;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

package net.pixelcop.sewer.sink;




public class TcpWriteableEventSink extends Sink {

  private static final Logger LOG = LoggerFactory.getLogger(TcpWriteableEventSink.class);

  private Socket socket;
  private DataOutputStream out;

  public TcpWriteableEventSink(String[] args) {
  }

  public void open() throws IOException {

    socket = new Socket("localhost", 9999);
    if (!socket.isConnected()) {