BinarySerializer: implement Closeable, Flushable
This commit is contained in:
parent
bf2076840e
commit
8789d7f40c
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package crosby.binary;
|
package crosby.binary;
|
||||||
|
|
||||||
|
import java.io.Closeable;
|
||||||
|
import java.io.Flushable;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -35,7 +37,7 @@ import crosby.binary.file.FileBlock;
|
||||||
* ordered to process their data at the appropriate time.
|
* ordered to process their data at the appropriate time.
|
||||||
* */
|
* */
|
||||||
|
|
||||||
public class BinarySerializer {
|
public class BinarySerializer implements Closeable, Flushable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface used to write a group of primitives. One of these for each
|
* Interface used to write a group of primitives. One of these for each
|
||||||
|
|
@ -92,11 +94,13 @@ public class BinarySerializer {
|
||||||
return stringtable;
|
return stringtable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void flush() throws IOException {
|
public void flush() throws IOException {
|
||||||
processBatch();
|
processBatch();
|
||||||
output.flush();
|
output.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void close() throws IOException {
|
public void close() throws IOException {
|
||||||
flush();
|
flush();
|
||||||
output.close();
|
output.close();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue