Description
hey folks. in IoBufferHexDumper.getHexdump(), we see this:
boolean truncate = in.remaining() > lengthLimit; int size; if (truncate) { size = lengthLimit; } else { size = in.remaining(); } if (size == 0) { return "empty"; } StringBuilder out = new StringBuilder(in.remaining() * 3 - 1);
note that the allocation uses in.remaining(), even though it'll only
insert the number of items indicated by "size". If the buffer is
particularly large, this is unnecessary and wasteful of memory.