From: Jussi Koskela Date: Thu, 13 Dec 2018 11:03:00 +0000 (+0200) Subject: Truncate size of the binary file X-Git-Tag: v1.43.0~136^2~226^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=3bcd1023180e2cdc55bc001d0f60075dd7184cfa;p=simantics%2Fplatform.git Truncate size of the binary file gitlab #233 Change-Id: I563e413ce2b3ecf3e1b3455221c3a3690bc31674 --- diff --git a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/ReadGraphImpl.java b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/ReadGraphImpl.java index 2ef40c294..79fe97464 100644 --- a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/ReadGraphImpl.java +++ b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/ReadGraphImpl.java @@ -5914,6 +5914,8 @@ public class ReadGraphImpl implements AsyncReadGraph { } Serializer serializer = binding.serializer(); byte[] bytes = serializer.serialize(initialValue); + // In case the file has been previously accessed and was larger we set the correct size now + rd.binaryFile.setLength(bytes.length); rd.binaryFile.write(bytes); ravs.put(resource, rd); return rd;