Class 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) and 0xAC (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 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 class FilterInputStream
        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