
com.zandero.rest.writer.BinaryResponseWriter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rest.vertx Show documentation
Show all versions of rest.vertx Show documentation
JAX-RS REST annotation processor for vert.x verticals
The newest version!
package com.zandero.rest.writer;
import io.netty.handler.codec.http.*;
import io.vertx.core.buffer.*;
import io.vertx.core.http.*;
/**
* Serves binary data as response
*/
public class BinaryResponseWriter implements HttpResponseWriter {
@Override
public void write(byte[] result, HttpServerRequest request, HttpServerResponse response) throws Throwable {
if (result == null) {
response.setStatusCode(HttpResponseStatus.NO_CONTENT.code()).end();
return;
}
response.send(Buffer.buffer(result));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy