Class WPFilterInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- com.logicaldoc.core.parser.wordperfect.WPFilterInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class WPFilterInputStream extends FilterInputStream
A FilterInputStream that processes bytes that have a special meaning in WordPerfect documents. Processed characters are:0x80
(space character in WP 6),0xA9
(hyphen in WP 6) and0xAC
(word break indicator).This class is made available as a utility class as other file formats may also use WordPerfect's file structure, e.g. Corel Presentations 3.0 files.
-
-
Constructor Summary
Constructors Constructor Description WPFilterInputStream(InputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
fillByteArray(InputStream in, byte[] byteArray)
Fills the supplied byte array with bytes read from the specified InputStream.int
read()
Converts all characters to 0 except for the readable ASCII-characters and characters from special byte sequences.int
read(byte[] byteArray, int off, int len)
-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
WPFilterInputStream
public WPFilterInputStream(InputStream in)
-
-
Method Detail
-
read
public int read() throws IOException
Converts all characters to 0 except for the readable ASCII-characters and characters from special byte sequences.- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
public int read(byte[] byteArray, int off, int len) throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
fillByteArray
public int fillByteArray(InputStream in, byte[] byteArray) throws IOException
Fills the supplied byte array with bytes read from the specified InputStream. This method will only stop reading when the byte array has been filled completely, or when the end of the stream has been reached- Parameters:
in
- The InputStream to read the bytes from.byteArray
- The byte array to fill with bytes- Returns:
- The number of bytes written to the byte array
- Throws:
IOException
- if an error happens retrieving the stream
-
-