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) CompressFlags
compression
(package private) java.io.OutputStream
outwrite
(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 void
close()
void
flush()
void
setCompress(CompressFlags flag)
void
setCompress(java.lang.String s)
void
write(FileBlock block)
Write a block with the stream's default compression flagvoid
write(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:
flush
in interfacejava.io.Flushable
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-