camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [10/26] git commit: CAMEL-6555 Fixed the NettyConverter to bytes test issue
Date Tue, 22 Jul 2014 13:52:58 GMT
CAMEL-6555 Fixed the NettyConverter to bytes test issue


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6d506406
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6d506406
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6d506406

Branch: refs/heads/master
Commit: 6d5064063ef1461ee440237b73672655f404f9da
Parents: fa24812
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Sun Jul 20 16:09:34 2014 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Tue Jul 22 21:25:18 2014 +0800

----------------------------------------------------------------------
 .../java/org/apache/camel/component/netty4/NettyConverter.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/6d506406/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConverter.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConverter.java
b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConverter.java
index 6800209..9278a18 100644
--- a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConverter.java
+++ b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConverter.java
@@ -51,7 +51,10 @@ public final class NettyConverter {
 
     @Converter
     public static byte[] toByteArray(ByteBuf buffer, Exchange exchange) {
-        return buffer.array();
+        byte[] bytes = new byte[buffer.readableBytes()];
+        int readerIndex = buffer.readerIndex();
+        buffer.getBytes(readerIndex, bytes);
+        return bytes;
     }
 
     @Converter


Mime
View raw message