From: Tuukka Lehtonen Date: Sun, 26 Aug 2018 13:03:47 +0000 (+0300) Subject: Backported StreamingTransferableGraphFileReader 69d8f2b1 changes X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=734f07d2922610dbf6780d36d37e2e37e988cb2f;p=simantics%2Fplatform.git Backported StreamingTransferableGraphFileReader 69d8f2b1 changes These changes add support for reading identities in TG files that have names longer than 127 characters. This was first fixed in release/1.34.0 and this backports the changes to release/1.32.0.2. gitlab #33 Change-Id: Ie78804976457e1bff86842a09d5d76c727df514a --- diff --git a/bundles/org.simantics.graph.db/src/org/simantics/graph/db/StreamingTransferableGraphFileReader.java b/bundles/org.simantics.graph.db/src/org/simantics/graph/db/StreamingTransferableGraphFileReader.java index 86c3d2fcb..f8fbb021e 100644 --- a/bundles/org.simantics.graph.db/src/org/simantics/graph/db/StreamingTransferableGraphFileReader.java +++ b/bundles/org.simantics.graph.db/src/org/simantics/graph/db/StreamingTransferableGraphFileReader.java @@ -229,7 +229,7 @@ final public class StreamingTransferableGraphFileReader extends ByteFileReader { if(type == 1) { int parent = safeInt(); - int nameLen = bytes[byteIndex++]&0xff; + int nameLen = getDynamicUInt32(); if(byteIndex+nameLen < SIZE) { procedure.execute(new Identity(rid, new External(parent, utf(bytes, byteIndex, byteIndex + nameLen)))); @@ -243,7 +243,7 @@ final public class StreamingTransferableGraphFileReader extends ByteFileReader { else if(type == 3) { int parent = safeInt(); - int nameLen = bytes[byteIndex++]&0xff; + int nameLen = getDynamicUInt32(); if(byteIndex+nameLen < SIZE) { procedure.execute(new Identity(rid, new Internal(parent, utf(bytes, byteIndex, byteIndex + nameLen)))); byteIndex += nameLen; @@ -255,9 +255,9 @@ final public class StreamingTransferableGraphFileReader extends ByteFileReader { // Root else if(type == 0) { - int nameLen = bytes[byteIndex++]&0xff; + int nameLen = getDynamicUInt32(); String name = utf(safeBytes(nameLen), 0, nameLen); - int nameLen2 = bytes[byteIndex++]&0xff; + int nameLen2 = getDynamicUInt32(); String rType = utf(safeBytes(nameLen2), 0, nameLen2); procedure.execute(new Identity(rid, new Root(name, rType)));