Commit aea18767 authored by Eric Bruneton's avatar Eric Bruneton
Browse files

Fix typos.

parent 08b54b42
...@@ -314,7 +314,7 @@ public class ClassReader { ...@@ -314,7 +314,7 @@ public class ClassReader {
if (inputStream == null) { if (inputStream == null) {
throw new IOException("Class not found"); throw new IOException("Class not found");
} }
int bufferSize = calculateBufferSize(inputStream); int bufferSize = computeBufferSize(inputStream);
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
byte[] data = new byte[bufferSize]; byte[] data = new byte[bufferSize];
int bytesRead; int bytesRead;
...@@ -335,12 +335,12 @@ public class ClassReader { ...@@ -335,12 +335,12 @@ public class ClassReader {
} }
} }
private static int calculateBufferSize(final InputStream inputStream) throws IOException { private static int computeBufferSize(final InputStream inputStream) throws IOException {
int expectedLength = inputStream.available(); int expectedLength = inputStream.available();
/* /*
* Some implementations can return 0 while holding available data (e.g. new * Some implementations can return 0 while holding available data (e.g. new
* FileInputStream("/proc/a_file")) Also in some pathological cases a very small number might be * FileInputStream("/proc/a_file")). Also in some pathological cases a very small number might
* returned, and in this case we use default size * be returned, and in this case we use a default size.
*/ */
if (expectedLength < 256) { if (expectedLength < 256) {
return INPUT_STREAM_DATA_CHUNK_SIZE; return INPUT_STREAM_DATA_CHUNK_SIZE;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment