code: private void processReplacements(DirectoryEntry parentDirectory, String fileName, Map<String, String> replacements, boolean unicode) throws IOException
     {
        //
        // Populate a list of keys and sort into descending order of length
        //
        List<String> keys = new ArrayList<String>(replacements.keySet());
        Collections.sort(keys, new Comparator<String>()
        {
           @Override public int compare(String o1, String o2)
           {
              return (o2.length() - o1.length());
           }
        });
  
        //
        // Extract the raw file data
        //
        DocumentEntry targetFile = (DocumentEntry) parentDirectory.getEntry(fileName);
        DocumentInputStream dis = new DocumentInputStream(targetFile);
        int dataSize = dis.available();
        byte[] data = new byte[dataSize];
        dis.read(data);
        dis.close();
  
        //
        // Replace the text
        //
        for (String findText : keys)
        {
           String replaceText = replacements.get(findText);
           replaceData(data, findText, replaceText, unicode);
        }
  
        //
        // Remove the document entry
        //
        targetFile.delete();
  
        //
        // Replace it with a new one
        //
        parentDirectory.createDocument(fileName, new ByteArrayInputStream(data));
     }
docs: Extracts a block of data from the MPP file, and iterates through the map
  of find/replace pairs to make the data anonymous.
  
  @param parentDirectory parent directory object
  @param fileName target file name
  @param replacements find/replace data
  @param unicode true for double byte text
  @throws IOException