src/main/java/org/java_websocket/SSLSocketChannel.java
private ByteBuffer handleBufferUnderflow( ByteBuffer buffer ) {
		if( engine.getSession().getPacketBufferSize() < buffer.limit() ) {
			return buffer;
		} else {
			ByteBuffer replaceBuffer = enlargePacketBuffer( buffer );
			buffer.flip();
			replaceBuffer.put( buffer );
			return replaceBuffer;
		}
	}
private ByteBuffer handleBufferUnderflow( ByteBuffer buffer ) {
		if( engine.getSession().getPacketBufferSize() < buffer.limit() ) {
			return buffer;
		} else {
			ByteBuffer replaceBuffer = enlargePacketBuffer( buffer );
			buffer.flip();
			replaceBuffer.put( buffer );
			return replaceBuffer;
		}
	}
private ByteBuffer handleBufferUnderflow ( ByteBuffer buffer ) { if ( engine . getSession ( ) . getPacketBufferSize ( ) < buffer . limit ( ) ) { return buffer ; } else { ByteBuffer replaceBuffer = enlargePacketBuffer ( buffer ) ; buffer . flip ( ) ; replaceBuffer . put ( buffer ) ; return replaceBuffer ; } }
Handles {@link SSLEngineResult.Status#BUFFER_UNDERFLOW}. Will check if the buffer is already filled, and if there is no space problem
will return the same buffer, so the client tries to read again. If the buffer is already filled will try to enlarge the buffer either to
session's proposed size or to a larger capacity. A buffer underflow can happen only after an unwrap, so the buffer will always be a
peerNetData buffer.

@param buffer - will always be peerNetData buffer.
@return The same buffer if there is no space problem or a new buffer with the same data but more space.
Handles { @link SSLEngineResult . Status#BUFFER_UNDERFLOW } . Will check if the buffer is already filled and if there is no space problem will return the same buffer so the client tries to read again . If the buffer is already filled will try to enlarge the buffer either to session s proposed size or to a larger capacity . A buffer underflow can happen only after an unwrap so the buffer will always be a peerNetData buffer .