diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2011-01-31 16:10:23 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2011-01-31 16:10:23 +0000 |
commit | ab331e479cbbc9481b99e19fd0348eec445cac20 (patch) | |
tree | b13b41a626e77f60ff49d973aa07be68910cc275 /src/com | |
parent | d6fc0ed8216ad6dc8caf1362c4c5f772e8c8f68c (diff) | |
download | vaadin-framework-ab331e479cbbc9481b99e19fd0348eec445cac20.tar.gz vaadin-framework-ab331e479cbbc9481b99e19fd0348eec445cac20.zip |
fixes #6360
svn changeset:17093/svn branch:6.5
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index 39b5c204a1..8606080802 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -5,6 +5,7 @@ package com.vaadin.terminal.gwt.server; import java.io.BufferedWriter; +import java.io.ByteArrayOutputStream; import java.io.CharArrayWriter; import java.io.IOException; import java.io.InputStream; @@ -16,6 +17,7 @@ import java.io.Serializable; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URL; +import java.nio.charset.Charset; import java.security.GeneralSecurityException; import java.text.DateFormat; import java.text.DateFormatSymbols; @@ -352,16 +354,17 @@ public abstract class AbstractCommunicationManager implements private static final String CRLF = "\r\n"; + private static final Charset UTF8 = Charset.forName("UTF8"); + private static String readLine(InputStream stream) throws IOException { - StringBuilder sb = new StringBuilder(); + ByteArrayOutputStream bout = new ByteArrayOutputStream(); int readByte = stream.read(); while (readByte != LF) { - char c = (char) readByte; - sb.append(c); + bout.write(readByte); readByte = stream.read(); } - - return sb.substring(0, sb.length() - 1); + byte[] bytes = bout.toByteArray(); + return new String(bytes, 0, bytes.length - 1, UTF8); } /** |