COMPRESS-452 document new constructors
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 37da29a..316a074 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -81,6 +81,16 @@
<action issue="COMPRESS-451" type="fix" date="2018-05-04">
IOUtils.copy now verifies the buffer size is bigger than 0.
</action>
+ <action issue="COMPRESS-452" type="add" date="2018-05-09">
+ New constructors have been added to <code>SevenZFile</code>
+ that accept <code>char[]</code>s rather than
+ <code>byte[]</code>s in order to avoid a common error of using
+ the wrong encoding when creating the <code>byte[]</code>.
+ This change may break source compatibility for client code
+ that uses one of the constructors expecting a password and
+ passes in <code>null</code> as password. We recommend to
+ change the code to use a constructor without password argument.
+ </action>
</release>
<release version="1.16.1" date="2018-02-10"
description="Release 1.16.1">
diff --git a/src/site/xdoc/examples.xml b/src/site/xdoc/examples.xml
index 2d5bbe8..dc5184d 100644
--- a/src/site/xdoc/examples.xml
+++ b/src/site/xdoc/examples.xml
@@ -391,7 +391,22 @@
sevenZFile.read(content, offset, content.length - offset);
}
]]></source>
- </subsection>
+
+ <p>Starting with Compress 1.17 new constructors have been
+ added that accept the password as <code>char[]</code> rather
+ than a <code>byte[]</code>. We recommend you use these in
+ order to avoid the problem above.</p>
+
+<source><![CDATA[
+SevenZFile sevenZFile = new SevenZFile(new File("archive.7z"), "secret".toCharArray());
+SevenZArchiveEntry entry = sevenZFile.getNextEntry();
+byte[] content = new byte[entry.getSize()];
+LOOP UNTIL entry.getSize() HAS BEEN READ {
+ sevenZFile.read(content, offset, content.length - offset);
+}
+]]></source>
+
+ </subsection>
<subsection name="ar">