HttpData toHttpData(DataBuffer dataBuffer) {
        if (dataBuffer instanceof NettyDataBuffer) {
            return new ByteBufHttpData(((NettyDataBuffer) dataBuffer).getNativeBuffer(), false);
        }
        if (dataBuffer instanceof DefaultDataBuffer) {
            return new ByteBufHttpData(
                    Unpooled.wrappedBuffer(((DefaultDataBuffer) dataBuffer).getNativeBuffer()), false);
        }
        return new ByteBufHttpData(Unpooled.wrappedBuffer(dataBuffer.asByteBuffer()), false);
    }
HttpData toHttpData ( DataBuffer dataBuffer ) { if ( dataBuffer instanceof NettyDataBuffer ) { return new ByteBufHttpData ( ( ( NettyDataBuffer ) dataBuffer ) . getNativeBuffer ( ) , false ) ; } if ( dataBuffer instanceof DefaultDataBuffer ) { return new ByteBufHttpData ( Unpooled . wrappedBuffer ( ( ( DefaultDataBuffer ) dataBuffer ) . getNativeBuffer ( ) ) , false ) ; } return new ByteBufHttpData ( Unpooled . wrappedBuffer ( dataBuffer . asByteBuffer ( ) ) , false ) ; }
Converts a {@link DataBuffer} into an {@link HttpData}.