org.opensearch.migrations.replay.util.NettyUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of trafficReplayer Show documentation
Show all versions of trafficReplayer Show documentation
Everything opensearch migrations
package org.opensearch.migrations.replay.util;
import java.util.Collection;
import java.util.stream.Stream;
import com.google.errorprone.annotations.MustBeClosed;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
public final class NettyUtils {
@MustBeClosed
public static Stream createRefCntNeutralCloseableByteBufStream(Stream byteArrStream) {
return RefSafeStreamUtils.refSafeMap(byteArrStream, Unpooled::wrappedBuffer);
}
@MustBeClosed
public static Stream createRefCntNeutralCloseableByteBufStream(Collection byteArrCollection) {
return createRefCntNeutralCloseableByteBufStream(byteArrCollection.stream());
}
private NettyUtils() {}
}