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

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

package com.blade.mvc.http;

import io.netty.handler.codec.http.FullHttpResponse;

import java.io.InputStream;

public class StreamBody implements Body {

    private final InputStream content;

    public StreamBody(final InputStream content) {
        this.content = content;
    }

    public static StreamBody of(InputStream inputStream){
        return new StreamBody(inputStream);
    }

    @Override
    public FullHttpResponse write(BodyWriter writer) {
//        writer.onStream(content);
        return writer.onByteBuf(content);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy