Brett Meyer commented on Improvement HHH-7835

Andriy Kharchuk, wouldn't the following be simpler?

public static byte[] getBytesFromInputStream(
			InputStream inputStream) throws IOException {
		ByteArrayOutputStream buffer = new ByteArrayOutputStream();

		int nRead;
		byte[] data = new byte[4096];

		while ((nRead = inputStream.read(data, 0, data.length)) != -1) {
		  buffer.write(data, 0, nRead);
		}

		buffer.flush();

		return buffer.toByteArray();
	}

In a test using a 1.1MB jar, this method matches the one you attached. Does anyone see any reason why this simpler version wouldn't scale?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira