This commit is contained in:
Redkale
2017-03-07 10:09:26 +08:00
parent 52a34d3871
commit 024147344b
2 changed files with 14 additions and 0 deletions

View File

@@ -158,6 +158,10 @@ public abstract class Response<C extends Context, R extends Request<C>> {
this.context.responsePool.offer(this);
}
public void finish(final byte[] bs) {
finish(ByteBuffer.wrap(bs));
}
public void finish(ByteBuffer buffer) {
this.channel.write(buffer, buffer, finishHandler);
}

View File

@@ -356,6 +356,16 @@ public class HttpResponse extends Response<HttpContext, HttpRequest> {
super.finish(buffer404.duplicate());
}
/**
* 将指定byte[]按响应结果输出
*
* @param bs 输出内容
*/
@Override
public void finish(final byte[] bs) {
finish(false, ByteBuffer.wrap(bs));
}
/**
* 将指定ByteBuffer按响应结果输出
*