Use IoUtils to avoid byte by byte copy
Change-Id: Ib1c6cce7f63cdb1de6335c35b1c00a78e5691f77
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java
index 2c79901..0a12189 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java
@@ -16,6 +16,7 @@
package org.onosproject.yang.compiler.datamodel.utils;
+import org.apache.commons.io.IOUtils;
import org.onosproject.yang.compiler.datamodel.CollisionDetector;
import org.onosproject.yang.compiler.datamodel.ConflictResolveNode;
import org.onosproject.yang.compiler.datamodel.DefaultYangNamespace;
@@ -897,9 +898,7 @@
InputStream inputStream = jar.getInputStream(file);
FileOutputStream fileOutputStream = new FileOutputStream(serializedFile);
- while (inputStream.available() > 0) {
- fileOutputStream.write(inputStream.read());
- }
+ IOUtils.copy(inputStream, fileOutputStream);
fileOutputStream.close();
inputStream.close();
//As of now only one metadata files will be there so if we