All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opensearch.migrations.replay.util.NettyUtils Maven / Gradle / Ivy

There is a newer version: 0.2.0.4
Show newest version
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 - 2024 Weber Informatics LLC | Privacy Policy