accumulate
@Nullable
public static org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf accumulate(org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf target,
org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf source,
int targetAccumulationSize,
int accumulatedSize)
Accumulates data from source to target. If no data has been accumulated yet
and source has enough data, source will be returned directly. Otherwise,
data will be copied into target. If the size of data copied after this operation has
reached targetAccumulationSize, target will be returned, otherwise
null will be returned to indicate more data is required.
- Parameters:
target - The target buffer.
source - The source buffer.
targetAccumulationSize - The target size of data to accumulate.
accumulatedSize - The size of data accumulated so far.
- Returns:
- The ByteBuf containing accumulated data. If not enough data has been accumulated,
null will be returned.