src/main/java/org/embulk/output/td/MsgpackGZFileBuilder.java in embulk-output-td-0.1.4 vs src/main/java/org/embulk/output/td/MsgpackGZFileBuilder.java in embulk-output-td-0.1.5
- old
+ new
@@ -1,8 +1,7 @@
package org.embulk.output.td;
-import org.embulk.spi.Exec;
import org.msgpack.MessagePack;
import org.msgpack.packer.Packer;
import java.io.BufferedOutputStream;
import java.io.Closeable;
@@ -16,33 +15,39 @@
import static com.google.common.base.Preconditions.checkNotNull;
public class MsgpackGZFileBuilder
implements Closeable
{
- static class DataSizeFilter extends FilterOutputStream {
+ static class DataSizeFilter
+ extends FilterOutputStream
+ {
private long size = 0;
- public DataSizeFilter(OutputStream out) {
+ public DataSizeFilter(OutputStream out)
+ {
super(out);
}
@Override
- public void write(int b) throws IOException
+ public void write(int b)
+ throws IOException
{
size += 1;
super.write(b);
}
@Override
- public void write(byte[] b, int off, int len) throws IOException
+ public void write(byte[] b, int off, int len)
+ throws IOException
{
size += len;
super.write(b, off, len);
}
@Override
- public void close() throws IOException
+ public void close()
+ throws IOException
{
super.close();
}
public long size()
@@ -92,10 +97,11 @@
public void finish()
throws IOException
{
try {
packer.flush();
- } finally {
+ }
+ finally {
close();
}
}
@Override