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

com.blade.mvc.http.EmptyBody Maven / Gradle / Ivy

package com.blade.mvc.http;

import io.netty.buffer.Unpooled;
import io.netty.handler.codec.http.FullHttpResponse;
import lombok.NoArgsConstructor;

@NoArgsConstructor
public class EmptyBody implements Body {

    private static final EmptyBody INSTANCE = new EmptyBody();

    public static EmptyBody empty() {
        return INSTANCE;
    }

    @Override
    public FullHttpResponse write(BodyWriter writer) {
        return writer.onByteBuf( Unpooled.buffer(0));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy