public static WPPrefixArea extract(WPInputStream in) throws IOException {
        WPPrefixArea prefixArea = new WPPrefixArea();

        in.mark(30);
        prefixArea.setFileId(in.readWPString(4));         // 1-4
        prefixArea.setDocAreaPointer(in.readWPLong());    // 5-8
        prefixArea.setProductType(in.readWP());           // 9
        prefixArea.setFileType(in.readWPChar());          // 10
        prefixArea.setMajorVersion(in.readWP());          // 11
        prefixArea.setMinorVersion(in.readWP());          // 12
        prefixArea.setEncrypted(in.readWPShort() != 0);   // 13-14
        prefixArea.setIndexAreaPointer(in.readWPShort()); // 15-16

        // only applies to 6.x:
        prefixArea.setFileSize(-1);
        if (prefixArea.getMajorVersion() == WPPrefixArea.WP6_MAJOR_VERSION) {
            try {
                in.skip(4); // 4 reserved bytes: skip     // 17-20
                prefixArea.setFileSize(in.readWPLong());      // 21-24
            } catch (IOException e) {
                // May fail if no index header, which is fine.
            }
        }

        in.reset();

        return prefixArea;
    }
Extracts WordPerfect Prefix Area data from a WordPerfect document.
Applies to both 5.x and 6+ documents.

@author Pascal Essiembre
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-miscoffice-module/src/main/java/org/apache/tika/parser/wordperfect/WPPrefixAreaExtractor.java