Skip to content

Commit 6671558

Browse files
committed
buffer: bug fixing
1 parent 43a7951 commit 6671558

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

jooby/src/main/java/io/jooby/internal/HttpMessageEncoder.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ public BufferedOutput encode(@NonNull Context ctx, @NonNull Object value) throws
9292
return outputFactory.wrap(bytes);
9393
}
9494
if (value instanceof ByteBuffer buffer) {
95-
ctx.send(buffer);
96-
return null;
95+
return outputFactory.wrap(buffer);
9796
}
9897
if (encoders != null) {
9998
// Content negotiation, find best:

modules/jooby-netty/src/main/java/io/jooby/internal/netty/NettyBufferedOutputFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public BufferedOutput wrap(@NonNull String value, @NonNull Charset charset) {
7373

7474
@Override
7575
@NonNull public BufferedOutput wrap(@NonNull byte[] bytes, int offset, int length) {
76-
return new NettyByteArrayWrappedOutput(bytes, 0, bytes.length);
76+
return new NettyByteArrayWrappedOutput(bytes, offset, length);
7777
}
7878

7979
@Override

0 commit comments

Comments
 (0)