ctubbsii commented on a change in pull request #1077: Updated commons config
from ver 1 to 2
URL: https://github.com/apache/fluo/pull/1077#discussion_r313146325
##########
File path:
modules/api/src/main/java/org/apache/fluo/api/config/SimpleConfiguration.java
##########
@@ -335,4 +334,35 @@ private void readObject(ObjectInputStream in) throws
IOException, ClassNotFoundE
ByteArrayInputStream bais = new ByteArrayInputStream(data);
load(bais);
}
+
+ private String stream2String(InputStream in) {
+ try {
+ ByteArrayOutputStream result = new ByteArrayOutputStream();
+ byte[] buffer = new byte[4096];
+ int length;
+ while ((length = in.read(buffer)) != -1) {
Review comment:
Configuration files are relatively small. Will this stream ever be
sufficiently large to warrant this bufferred reading approach, rather than
simply reading the whole stream in? We're eventually reading the whole stream
into memory anyway. Why not just readFully or similar?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services