- java.lang.Object
 - 
- io.netty5.channel.DefaultMaxBytesRecvBufferAllocator
 
 
- 
- All Implemented Interfaces:
 MaxBytesRecvBufferAllocator,RecvBufferAllocator
public class DefaultMaxBytesRecvBufferAllocator extends Object implements MaxBytesRecvBufferAllocator
TheRecvBufferAllocatorthat yields a buffer size prediction based upon decrementing the value from the max bytes per read. 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from interface io.netty5.channel.RecvBufferAllocator
RecvBufferAllocator.Handle 
 - 
 
- 
Constructor Summary
Constructors Constructor Description DefaultMaxBytesRecvBufferAllocator()DefaultMaxBytesRecvBufferAllocator(int maxBytesPerRead, int maxBytesPerIndividualRead) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intmaxBytesPerIndividualRead()Returns the maximum number of bytes to read per individual read operation.DefaultMaxBytesRecvBufferAllocatormaxBytesPerIndividualRead(int maxBytesPerIndividualRead)Sets the maximum number of bytes to read per individual read operation.intmaxBytesPerRead()Returns the maximum number of bytes to read per read loop.DefaultMaxBytesRecvBufferAllocatormaxBytesPerRead(int maxBytesPerRead)Sets the maximum number of bytes to read per read loop.Map.Entry<Integer,Integer>maxBytesPerReadPair()Atomic way to get the maximum number of bytes to read for a read loop and per individual read operation.DefaultMaxBytesRecvBufferAllocatormaxBytesPerReadPair(int maxBytesPerRead, int maxBytesPerIndividualRead)Sets the maximum number of bytes to read for a read loop and per individual read operation.RecvBufferAllocator.HandlenewHandle()Creates a new handle. 
 - 
 
- 
- 
Method Detail
- 
newHandle
public RecvBufferAllocator.Handle newHandle()
Description copied from interface:RecvBufferAllocatorCreates a new handle. The handle provides the actual operations and keeps the internal information which is required for predicting an optimal buffer capacity.- Specified by:
 newHandlein interfaceRecvBufferAllocator
 
- 
maxBytesPerRead
public int maxBytesPerRead()
Description copied from interface:MaxBytesRecvBufferAllocatorReturns the maximum number of bytes to read per read loop. achannelRead()event. If this value is greater than 1, an event loop might attempt to read multiple times to procure bytes.- Specified by:
 maxBytesPerReadin interfaceMaxBytesRecvBufferAllocator
 
- 
maxBytesPerRead
public DefaultMaxBytesRecvBufferAllocator maxBytesPerRead(int maxBytesPerRead)
Description copied from interface:MaxBytesRecvBufferAllocatorSets the maximum number of bytes to read per read loop. If this value is greater than 1, an event loop might attempt to read multiple times to procure bytes.- Specified by:
 maxBytesPerReadin interfaceMaxBytesRecvBufferAllocator
 
- 
maxBytesPerIndividualRead
public int maxBytesPerIndividualRead()
Description copied from interface:MaxBytesRecvBufferAllocatorReturns the maximum number of bytes to read per individual read operation. achannelRead()event. If this value is greater than 1, an event loop might attempt to read multiple times to procure bytes.- Specified by:
 maxBytesPerIndividualReadin interfaceMaxBytesRecvBufferAllocator
 
- 
maxBytesPerIndividualRead
public DefaultMaxBytesRecvBufferAllocator maxBytesPerIndividualRead(int maxBytesPerIndividualRead)
Description copied from interface:MaxBytesRecvBufferAllocatorSets the maximum number of bytes to read per individual read operation. If this value is greater than 1, an event loop might attempt to read multiple times to procure bytes.- Specified by:
 maxBytesPerIndividualReadin interfaceMaxBytesRecvBufferAllocator
 
- 
maxBytesPerReadPair
public Map.Entry<Integer,Integer> maxBytesPerReadPair()
Description copied from interface:MaxBytesRecvBufferAllocatorAtomic way to get the maximum number of bytes to read for a read loop and per individual read operation. If this value is greater than 1, an event loop might attempt to read multiple times to procure bytes.- Specified by:
 maxBytesPerReadPairin interfaceMaxBytesRecvBufferAllocator- Returns:
 - The Key is from 
MaxBytesRecvBufferAllocator.maxBytesPerRead(). The Value is fromMaxBytesRecvBufferAllocator.maxBytesPerIndividualRead() 
 
- 
maxBytesPerReadPair
public DefaultMaxBytesRecvBufferAllocator maxBytesPerReadPair(int maxBytesPerRead, int maxBytesPerIndividualRead)
Description copied from interface:MaxBytesRecvBufferAllocatorSets the maximum number of bytes to read for a read loop and per individual read operation. If this value is greater than 1, an event loop might attempt to read multiple times to procure bytes.- Specified by:
 maxBytesPerReadPairin interfaceMaxBytesRecvBufferAllocator- Parameters:
 maxBytesPerRead- seeMaxBytesRecvBufferAllocator.maxBytesPerRead(int)maxBytesPerIndividualRead- seeMaxBytesRecvBufferAllocator.maxBytesPerIndividualRead(int)
 
 - 
 
 -