@@ -0,0 +1,1454 @@
+package edu.berkeley.cs.amplab.smash4j;%0A%0Aimport com.google.common.base.Function;%0Aimport com.google.common.base.Functions;%0Aimport com.google.common.collect.FluentIterable;%0A%0Aimport edu.berkeley.cs.amplab.smash4j.Smash4J.VariantProto;%0A%0Aimport java.io.OutputStream;%0A%0Apublic class VariantWriter %7B%0A%0A  public static VariantWriter create(OutputStream out) %7B%0A    return new VariantWriter(out, Functions.%3CIterable%3CVariantProto%3E%3Eidentity());%0A  %7D%0A%0A  private final OutputStream out;%0A  private final Function%3C? super Iterable%3CVariantProto%3E, ? extends Iterable%3CVariantProto%3E%3E transformer;%0A%0A  private VariantWriter(%0A      OutputStream out,%0A      Function%3C? super Iterable%3CVariantProto%3E, ? extends Iterable%3CVariantProto%3E%3E transformer) %7B%0A    this.out = out;%0A    this.transformer = transformer;%0A  %7D%0A%0A  public VariantWriter transform(Function%3C? super Iterable%3CVariantProto%3E, ? extends Iterable%3CVariantProto%3E%3E transformer) %7B%0A    return new VariantWriter(out, Functions.compose(transformer, this.transformer));%0A  %7D%0A%0A  public VariantWriter writeVariants(VariantScanner scanner) throws Exception %7B%0A    return scanner.scan(%0A        new VariantScanner.Callback%3CVariantWriter%3E() %7B%0A          @Override public VariantWriter accept(FluentIterable%3CVariantProto%3E variants)%0A              throws Exception %7B%0A            for (VariantProto variant : variants) %7B%0A              variant.writeDelimitedTo(out);%0A            %7D%0A            return VariantWriter.this;%0A          %7D%0A        %7D);%0A  %7D%0A%7D%0A

Add VariantWriter.java