Merge "Check the version of format options before writing."
commit
40e91e4582
|
@ -68,6 +68,12 @@ public class Ver3DictEncoder implements DictEncoder {
|
||||||
@Override
|
@Override
|
||||||
public void writeDictionary(final FusionDictionary dict, final FormatOptions formatOptions)
|
public void writeDictionary(final FusionDictionary dict, final FormatOptions formatOptions)
|
||||||
throws IOException, UnsupportedFormatException {
|
throws IOException, UnsupportedFormatException {
|
||||||
|
if (formatOptions.mVersion > 3) {
|
||||||
|
throw new UnsupportedFormatException(
|
||||||
|
"The given format options has wrong version number : "
|
||||||
|
+ formatOptions.mVersion);
|
||||||
|
}
|
||||||
|
|
||||||
if (mOutStream == null) {
|
if (mOutStream == null) {
|
||||||
openStream();
|
openStream();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue