org.opensearch.migrations.replay.util.NettyUtils Maven / Gradle / Ivy
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() {}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy