changeset 23368:30544794ea23

[IGV] Fix String object reading from BinaryGraphs Strings in BinaryGraphs are represented as utf8 with 2 bytes for each character. Change 5e8be3095c53 falsely changed the code to read just 1byte per characer.
author Stefan Anzinger <stefan.anzinger@oracle.com>
date Sun, 01 May 2016 11:24:36 +0200
parents 041534002323
children 5aa3b3a72e35
files src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/BinaryParser.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/BinaryParser.java	Fri Apr 29 14:49:30 2016 +0200
+++ b/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/BinaryParser.java	Sun May 01 11:24:36 2016 +0200
@@ -341,11 +341,15 @@
     }
 
     private String readString() throws IOException {
-        return new String(readBytes(), utf8).intern();
+        return new String(readElements(2), utf8).intern();
     }
 
     private byte[] readBytes() throws IOException {
-        int len = readInt();
+        return readElements(1);
+    }
+    
+    private byte[] readElements(int elementSize) throws IOException {
+        int len = readInt() * elementSize;
         if (len < 0) {
             return null;
         }