Package org.h2.compress
Class LZFOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.h2.compress.LZFOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class LZFOutputStream extends java.io.OutputStreamAn output stream to write an LZF stream. The data is automatically compressed.
-
-
Constructor Summary
Constructors Constructor Description LZFOutputStream(java.io.OutputStream out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()private voidcompressAndWrite(byte[] buff, int len)private voidensureOutput(int len)voidflush()voidwrite(byte[] buff, int off, int len)voidwrite(int b)private voidwriteInt(int x)
-
-
-
Field Detail
-
MAGIC
static final int MAGIC
The file header of a LZF file.- See Also:
- Constant Field Values
-
out
private final java.io.OutputStream out
-
compress
private final CompressLZF compress
-
buffer
private final byte[] buffer
-
pos
private int pos
-
outBuffer
private byte[] outBuffer
-
-
Method Detail
-
ensureOutput
private void ensureOutput(int len)
-
write
public void write(int b) throws java.io.IOException- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
compressAndWrite
private void compressAndWrite(byte[] buff, int len) throws java.io.IOException- Throws:
java.io.IOException
-
writeInt
private void writeInt(int x) throws java.io.IOException- Throws:
java.io.IOException
-
write
public void write(byte[] buff, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream- Throws:
java.io.IOException
-
-