BlockReaderAdapter: implement Closeable, Flushable
This commit is contained in:
parent
1c7fadcde8
commit
3dac689ea7
|
|
@ -17,7 +17,9 @@
|
||||||
|
|
||||||
package crosby.binary.file;
|
package crosby.binary.file;
|
||||||
|
|
||||||
|
import java.io.Closeable;
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
|
import java.io.Flushable;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -27,7 +29,7 @@ enum CompressFlags {
|
||||||
NONE, DEFLATE
|
NONE, DEFLATE
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BlockOutputStream {
|
public class BlockOutputStream implements Closeable, Flushable {
|
||||||
|
|
||||||
public BlockOutputStream(OutputStream output) {
|
public BlockOutputStream(OutputStream output) {
|
||||||
this.outwrite = new DataOutputStream(output);
|
this.outwrite = new DataOutputStream(output);
|
||||||
|
|
@ -59,10 +61,12 @@ public class BlockOutputStream {
|
||||||
writtenblocks.add(ref);
|
writtenblocks.add(ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void flush() throws IOException {
|
public void flush() throws IOException {
|
||||||
outwrite.flush();
|
outwrite.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void close() throws IOException {
|
public void close() throws IOException {
|
||||||
outwrite.flush();
|
outwrite.flush();
|
||||||
outwrite.close();
|
outwrite.close();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue