RecvByteBufAllocator Type — netty Architecture
Architecture documentation for the RecvByteBufAllocator type/interface in RecvByteBufAllocator.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 2dfb9f7f_0609_8a3a_a395_45244daa9e93["RecvByteBufAllocator"] 1b6a4263_0eda_567c_63bc_9cb3e6a91bbc["RecvByteBufAllocator.java"] 2dfb9f7f_0609_8a3a_a395_45244daa9e93 -->|defined in| 1b6a4263_0eda_567c_63bc_9cb3e6a91bbc style 2dfb9f7f_0609_8a3a_a395_45244daa9e93 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
transport/src/main/java/io/netty/channel/RecvByteBufAllocator.java lines 29–187
public interface RecvByteBufAllocator {
/**
* Creates a new handle. The handle provides the actual operations and keeps the internal information which is
* required for predicting an optimal buffer capacity.
*/
Handle newHandle();
/**
* @deprecated Use {@link ExtendedHandle}.
*/
@Deprecated
interface Handle {
/**
* Creates a new receive buffer whose capacity is probably large enough to read all inbound data and small
* enough not to waste its space.
*/
ByteBuf allocate(ByteBufAllocator alloc);
/**
* Similar to {@link #allocate(ByteBufAllocator)} except that it does not allocate anything but just tells the
* capacity.
*/
int guess();
/**
* Reset any counters that have accumulated and recommend how many messages/bytes should be read for the next
* read loop.
* <p>
* This may be used by {@link #continueReading()} to determine if the read operation should complete.
* </p>
* This is only ever a hint and may be ignored by the implementation.
* @param config The channel configuration which may impact this object's behavior.
*/
void reset(ChannelConfig config);
/**
* Increment the number of messages that have been read for the current read loop.
* @param numMessages The amount to increment by.
*/
void incMessagesRead(int numMessages);
/**
* Set the bytes that have been read for the last read operation.
* This may be used to increment the number of bytes that have been read.
* @param bytes The number of bytes from the previous read operation. This may be negative if an read error
* occurs. If a negative value is seen it is expected to be return on the next call to
* {@link #lastBytesRead()}. A negative value will signal a termination condition enforced externally
* to this class and is not required to be enforced in {@link #continueReading()}.
*/
void lastBytesRead(int bytes);
/**
* Get the amount of bytes for the previous read operation.
* @return The amount of bytes for the previous read operation.
*/
int lastBytesRead();
/**
* Set how many bytes the read operation will (or did) attempt to read.
* @param bytes How many bytes the read operation will (or did) attempt to read.
*/
void attemptedBytesRead(int bytes);
/**
* Get how many bytes the read operation will (or did) attempt to read.
* @return How many bytes the read operation will (or did) attempt to read.
*/
int attemptedBytesRead();
/**
* Determine if the current read loop should continue.
* @return {@code true} if the read loop should continue reading. {@code false} if the read loop is complete.
*/
boolean continueReading();
/**
* The read has completed.
*/
void readComplete();
}
Source
Frequently Asked Questions
What is the RecvByteBufAllocator type?
RecvByteBufAllocator is a type/interface in the netty codebase, defined in transport/src/main/java/io/netty/channel/RecvByteBufAllocator.java.
Where is RecvByteBufAllocator defined?
RecvByteBufAllocator is defined in transport/src/main/java/io/netty/channel/RecvByteBufAllocator.java at line 29.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free