reswqa commented on code in PR #19960: URL: https://github.com/apache/flink/pull/19960#discussion_r909422919
########## flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/BufferReaderWriterUtil.java: ########## @@ -162,8 +162,19 @@ static Buffer readFileRegionFromByteChannel(FileChannel channel, ByteBuffer head return new FileRegionBuffer(channel, position, size, dataType, isCompressed); } + public static int setBufferWithHeader( + Buffer buffer, ByteBuffer[] bufferWithHeaders, int index) { + ByteBuffer header = BufferReaderWriterUtil.allocatedHeaderBuffer(); + BufferReaderWriterUtil.setByteChannelBufferHeader(buffer, header); + + bufferWithHeaders[index] = header; + bufferWithHeaders[index + 1] = buffer.getNioBufferReadable(); + + return header.remaining() + buffer.readableBytes(); + } Review Comment: Move this method to caller side and change return type to void. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org