Package crosby.binary.file
Class BlockOutputStream
- java.lang.Object
-
- crosby.binary.file.BlockOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class BlockOutputStream extends java.lang.Object implements java.io.Closeable, java.io.Flushable
-
-
Field Summary
Fields Modifier and Type Field Description (package private) CompressFlagscompression(package private) java.io.OutputStreamoutwrite(package private) java.util.List<FileBlockPosition>writtenblocks
-
Constructor Summary
Constructors Constructor Description BlockOutputStream(java.io.OutputStream output)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()voidsetCompress(CompressFlags flag)voidsetCompress(java.lang.String s)voidwrite(FileBlock block)Write a block with the stream's default compression flagvoidwrite(FileBlock block, CompressFlags compression)Write a specific block with a specific compression flags
-
-
-
Field Detail
-
outwrite
java.io.OutputStream outwrite
-
writtenblocks
java.util.List<FileBlockPosition> writtenblocks
-
compression
CompressFlags compression
-
-
Method Detail
-
setCompress
public void setCompress(CompressFlags flag)
-
setCompress
public void setCompress(java.lang.String s)
-
write
public void write(FileBlock block) throws java.io.IOException
Write a block with the stream's default compression flag- Throws:
java.io.IOException
-
write
public void write(FileBlock block, CompressFlags compression) throws java.io.IOException
Write a specific block with a specific compression flags- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-