Package org.h2.compress
Class LZFInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.h2.compress.LZFInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class LZFInputStream extends java.io.InputStream
An input stream to read from an LZF stream. The data is automatically expanded.
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
buffer
private int
bufferLength
private CompressLZF
decompress
private java.io.InputStream
in
private byte[]
inBuffer
private int
pos
-
Constructor Summary
Constructors Constructor Description LZFInputStream(java.io.InputStream in)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
private static byte[]
ensureSize(byte[] buff, int len)
private void
fillBuffer()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
private int
readBlock(byte[] b, int off, int len)
private void
readFully(byte[] buff, int len)
private int
readInt()
-
-
-
Field Detail
-
in
private final java.io.InputStream in
-
decompress
private CompressLZF decompress
-
pos
private int pos
-
bufferLength
private int bufferLength
-
inBuffer
private byte[] inBuffer
-
buffer
private byte[] buffer
-
-
Method Detail
-
ensureSize
private static byte[] ensureSize(byte[] buff, int len)
-
fillBuffer
private void fillBuffer() throws java.io.IOException
- Throws:
java.io.IOException
-
readFully
private void readFully(byte[] buff, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
readInt
private int readInt() throws java.io.IOException
- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
readBlock
private int readBlock(byte[] b, int off, int len) throws java.io.IOException
- 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
- Overrides:
close
in classjava.io.InputStream
- Throws:
java.io.IOException
-
-