private static final class ReleasableSSLBufferManagementStrategy.InternalBuffer extends java.lang.Object implements SSLBuffer
Modifier and Type | Field and Description |
---|---|
private int |
length |
private java.nio.ByteBuffer |
wrapped |
Constructor and Description |
---|
InternalBuffer(int size) |
Modifier and Type | Method and Description |
---|---|
java.nio.ByteBuffer |
acquire()
Allocates the resources required for this buffer, or returns the resources already allocated for this buffer.
|
boolean |
hasData()
Tests to make sure that the buffer has been acquired and the underlying buffer has a position larger than
0 . |
boolean |
isAcquired()
Tests to see if this buffer has been acquired.
|
void |
release()
Releases the resources for this buffer.
|
public java.nio.ByteBuffer acquire()
SSLBuffer
SSLBuffer.release()
is called, multiple invokations to this method must return the same
ByteBuffer
.public void release()
SSLBuffer
public boolean isAcquired()
SSLBuffer
isAcquired
in interface SSLBuffer
true
if the buffer is acquired, otherwise false
public boolean hasData()
SSLBuffer
0
. Essentially the same as isAquired() && acquire().position > 0
.