camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [1/2] git commit: CAMEL-6873 support the Exchange.CHARSET_NAME header in camel-gson, with thanks to Fergus
Date Mon, 21 Oct 2013 04:38:27 GMT
Updated Branches:
  refs/heads/camel-2.11.x 36f18c966 -> 561c78640
  refs/heads/camel-2.12.x f6e22cd92 -> 204d6ef15


CAMEL-6873 support the Exchange.CHARSET_NAME header in camel-gson, with thanks to Fergus


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

Branch: refs/heads/camel-2.12.x
Commit: 204d6ef159eecdbf3006c064d7ad6e67d5f1ece5
Parents: f6e22cd
Author: Willem Jiang <ningjiang@apache.org>
Authored: Mon Oct 21 12:29:49 2013 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Mon Oct 21 12:36:56 2013 +0800

----------------------------------------------------------------------
 .../java/org/apache/camel/component/gson/GsonDataFormat.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/204d6ef1/components/camel-gson/src/main/java/org/apache/camel/component/gson/GsonDataFormat.java
----------------------------------------------------------------------
diff --git a/components/camel-gson/src/main/java/org/apache/camel/component/gson/GsonDataFormat.java
b/components/camel-gson/src/main/java/org/apache/camel/component/gson/GsonDataFormat.java
index a5537e5..fc1a0d7 100644
--- a/components/camel-gson/src/main/java/org/apache/camel/component/gson/GsonDataFormat.java
+++ b/components/camel-gson/src/main/java/org/apache/camel/component/gson/GsonDataFormat.java
@@ -94,14 +94,14 @@ public class GsonDataFormat extends ServiceSupport implements DataFormat
{
 
     @Override
     public void marshal(Exchange exchange, Object graph, OutputStream stream) throws Exception
{
-        BufferedWriter writer = IOHelper.buffered(new OutputStreamWriter(stream));
+        BufferedWriter writer = IOHelper.buffered(new OutputStreamWriter(stream, IOHelper.getCharsetName(exchange)));
         gson.toJson(graph, writer);
         writer.close();
     }
 
     @Override
     public Object unmarshal(Exchange exchange, InputStream stream) throws Exception {
-        BufferedReader reader = IOHelper.buffered(new InputStreamReader(stream));
+        BufferedReader reader = IOHelper.buffered(new InputStreamReader(stream, IOHelper.getCharsetName(exchange)));
         Object result = gson.fromJson(reader, this.unmarshalType);
         reader.close();
         return result;


Mime
View raw message