Search in sources :

Example 1 with StateableSupport

use of org.jocean.idiom.StateableSupport in project jocean-http by isdom.

the class StreamUtil method allocStateableDWB.

public static DisposableWrapper<ByteBuf> allocStateableDWB(final int bufSize) {
    final ByteBufAllocator allocator = PooledByteBufAllocator.DEFAULT;
    final ByteBuf buf = allocator.buffer(bufSize, bufSize);
    return Proxys.mixin().mix(DisposableWrapper.class, RxNettys.wrap4release(buf)).mix(Stateable.class, new StateableSupport()).build();
}
Also used : ByteBufAllocator(io.netty.buffer.ByteBufAllocator) PooledByteBufAllocator(io.netty.buffer.PooledByteBufAllocator) Stateable(org.jocean.idiom.Stateable) ByteBuf(io.netty.buffer.ByteBuf) StateableSupport(org.jocean.idiom.StateableSupport)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)1 ByteBufAllocator (io.netty.buffer.ByteBufAllocator)1 PooledByteBufAllocator (io.netty.buffer.PooledByteBufAllocator)1 Stateable (org.jocean.idiom.Stateable)1 StateableSupport (org.jocean.idiom.StateableSupport)1