MCPcopy Create free account
hub / github.com/apache/cloudstack / enlargeBuffer

Method enlargeBuffer

utils/src/main/java/com/cloud/utils/nio/Link.java:457–467  ·  view source on GitHub ↗
(ByteBuffer buffer, final int sessionProposedCapacity)

Source from the content-addressed store, hash-verified

455 }
456
457 public static ByteBuffer enlargeBuffer(ByteBuffer buffer, final int sessionProposedCapacity) {
458 if (buffer == null || sessionProposedCapacity < 0) {
459 return buffer;
460 }
461 if (sessionProposedCapacity > buffer.capacity()) {
462 buffer = ByteBuffer.allocate(sessionProposedCapacity);
463 } else {
464 buffer = ByteBuffer.allocate(buffer.capacity() * 2);
465 }
466 return buffer;
467 }
468
469 public static ByteBuffer handleBufferUnderflow(final SSLEngine engine, final ByteBuffer buffer) {
470 if (engine == null || buffer == null) {

Callers 3

handleBufferUnderflowMethod · 0.95
doHandshakeUnwrapMethod · 0.95
doHandshakeWrapMethod · 0.95

Calls 1

allocateMethod · 0.65

Tested by

no test coverage detected