public class DefaultByteBufferFactory extends Object implements ByteBufferFactory
ByteBufferFactory
that creates heap-based ByteBuffer
s.
This behavior can be changed by passing in a custom Function
to the constructor.NioParams
,
ByteBufferFactory
Constructor and Description |
---|
DefaultByteBufferFactory() |
DefaultByteBufferFactory(Function<Integer,ByteBuffer> allocator) |
Modifier and Type | Method and Description |
---|---|
protected ByteBuffer |
createEncryptedByteBuffer(NioContext nioContext) |
ByteBuffer |
createEncryptedReadBuffer(NioContext nioContext)
Create the network read
ByteBuffer . |
ByteBuffer |
createEncryptedWriteBuffer(NioContext nioContext)
Create the network write
ByteBuffer . |
ByteBuffer |
createReadBuffer(NioContext nioContext)
Create the
ByteBuffer that contains inbound frames. |
ByteBuffer |
createWriteBuffer(NioContext nioContext)
Create the
ByteBuffer that contains outbound frames. |
public DefaultByteBufferFactory(Function<Integer,ByteBuffer> allocator)
public DefaultByteBufferFactory()
public ByteBuffer createReadBuffer(NioContext nioContext)
ByteBufferFactory
ByteBuffer
that contains inbound frames.
This buffer is the network buffer for plain connections.
When using SSL/TLS, this buffer isn't directly connected to
the network, the encrypted read buffer is.createReadBuffer
in interface ByteBufferFactory
public ByteBuffer createWriteBuffer(NioContext nioContext)
ByteBufferFactory
ByteBuffer
that contains outbound frames.
This buffer is the network buffer for plain connections.
When using SSL/TLS, this buffer isn't directed connected to
the network, the encrypted write buffer is.createWriteBuffer
in interface ByteBufferFactory
public ByteBuffer createEncryptedReadBuffer(NioContext nioContext)
ByteBufferFactory
ByteBuffer
.
This buffer contains encrypted frames read from the network.
The SSLEngine
decrypts frame and pass them
over to the read buffer.createEncryptedReadBuffer
in interface ByteBufferFactory
public ByteBuffer createEncryptedWriteBuffer(NioContext nioContext)
ByteBufferFactory
ByteBuffer
.
This buffer contains encrypted outbound frames. These
frames come from the write buffer that sends them through
the SSLContext
for encryption to
this buffer.createEncryptedWriteBuffer
in interface ByteBufferFactory
protected ByteBuffer createEncryptedByteBuffer(NioContext nioContext)
Copyright © 2022 VMware, Inc. or its affiliates.. All rights reserved.