Author: mattsicker
Date: Sun Jun 8 19:20:53 2014
New Revision: 1601242
URL: http://svn.apache.org/r1601242
Log:
Make toByteArray static and add javadoc.
Modified:
logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
Modified:
logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
URL:
http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java?rev=1601242&r1=1601241&r2=1601242&view=diff
==============================================================================
---
logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
(original)
+++
logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
Sun Jun 8 19:20:53 2014
@@ -766,7 +766,15 @@ public abstract class AbstractConfigurat
}
}
- protected byte[] toByteArray(final InputStream is) throws IOException {
+ /**
+ * Reads an InputStream using buffered reads into a byte array buffer. The
given InputStream will remain open
+ * after invocation of this method.
+ *
+ * @param is the InputStream to read into a byte array buffer.
+ * @return a byte array of the InputStream contents.
+ * @throws IOException if the {@code read} method of the provided
InputStream throws this exception.
+ */
+ protected static byte[] toByteArray(final InputStream is) throws
IOException {
final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
int nRead;