Package org.apache.poi.util
Class RLEDecompressingInputStream
java.lang.Object
java.io.InputStream
org.apache.poi.util.RLEDecompressingInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Wrapper of InputStream which provides Run Length Encoding (RLE)
decompression on the fly. Uses MS-OVBA decompression algorithm. See
http://download.microsoft.com/download/2/4/8/24862317-78F0-4C4B-B355-C7B2C1D997DB/[MS-OVBA].pdf
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new wrapper RLE Decompression InputStream. -
Method Summary
Modifier and TypeMethodDescriptionint
void
close()
static byte[]
decompress
(byte[] compressed) static byte[]
decompress
(byte[] compressed, int offset, int length) int
read()
int
read
(byte[] b) int
read
(byte[] b, int off, int l) int
readInt()
Convenience method for read a 4-bytes int in little endian encoding.int
Convenience method for read a 2-bytes short in little endian encoding.long
skip
(long n) Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skipNBytes, transferTo
-
Constructor Details
-
RLEDecompressingInputStream
Creates a new wrapper RLE Decompression InputStream.- Parameters:
in
- The stream to wrap with the RLE Decompression- Throws:
IOException
-
-
Method Details
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
available
public int available()- Overrides:
available
in classInputStream
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
readShort
Convenience method for read a 2-bytes short in little endian encoding.- Returns:
- short value from the stream, -1 if end of stream is reached
- Throws:
IOException
-
readInt
Convenience method for read a 4-bytes int in little endian encoding.- Returns:
- integer value from the stream, -1 if end of stream is reached
- Throws:
IOException
-
decompress
- Throws:
IOException
-
decompress
- Throws:
IOException
-