am 40e91e45: Merge "Check the version of format options before writing."

* commit '40e91e45825d31ae0bc075466406a4330b8df9bf':
  Check the version of format options before writing.
main
Ken Wakasa 2013-09-10 03:03:19 -07:00 committed by Android Git Automerger
commit bc435b788c
1 changed files with 6 additions and 0 deletions

View File

@ -68,6 +68,12 @@ public class Ver3DictEncoder implements DictEncoder {
@Override
public void writeDictionary(final FusionDictionary dict, final FormatOptions formatOptions)
throws IOException, UnsupportedFormatException {
if (formatOptions.mVersion > 3) {
throw new UnsupportedFormatException(
"The given format options has wrong version number : "
+ formatOptions.mVersion);
}
if (mOutStream == null) {
openStream();
}