(ByteBuffer buffer, final int sessionProposedCapacity)
| 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) { |
no test coverage detected