From 3bcd1023180e2cdc55bc001d0f60075dd7184cfa Mon Sep 17 00:00:00 2001 From: Jussi Koskela Date: Thu, 13 Dec 2018 13:03:00 +0200 Subject: [PATCH] Truncate size of the binary file gitlab #233 Change-Id: I563e413ce2b3ecf3e1b3455221c3a3690bc31674 --- .../src/org/simantics/db/impl/graph/ReadGraphImpl.java | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.47.1