Class ByteBufUtils

java.lang.Object
org.apache.flink.runtime.io.network.netty.ByteBufUtils

public class ByteBufUtils extends Object
Utility routines to process ByteBuf.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ByteBufUtils

      public ByteBufUtils()
  • Method Details

    • 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.