Finalizing improve startup time for fresh or rollback'd session 29/1629/5
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 5 Apr 2018 13:33:58 +0000 (16:33 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 5 Apr 2018 13:33:58 +0000 (16:33 +0300)
commitbf495713dbc9dec325f3929889466fa6cd58b541
tree802d00fd21f2831c714be09233262288597372e8
parent8ede4cc47cef9f74682972f88bcf7730a64e7fcd
Finalizing improve startup time for fresh or rollback'd session

Finally fixed the long-sought InputStream reading bug from
TransferableGraphFileReader.InputChannel.read(ByteBuffer).

The ByteFileReader implementation expected the provided
ReadableByteChannel to always provide a full buffer of data unless EOF
was encountered and the InputChannel.read implementation was not taking
care of that.

Also added simpler utilities for reading TG's from files/InputStreams
directly using static TransferableGraphFileReader.read(File/InputStream)
methods.

PlatformUtil.readTG can now finally use TransferableGraphFileReader for
maximal performance.

refs #7835

Change-Id: I170986bf271a409f9205fad808ae029becc1d3a4
bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/migration/MigrationStateImpl.java
bundles/org.simantics.db.testing/src/org/simantics/db/testing/common/TestingUtils.java
bundles/org.simantics.graph/src/org/simantics/graph/representation/TransferableGraph1Serializer.java
bundles/org.simantics.graph/src/org/simantics/graph/representation/TransferableGraphFileReader.java
bundles/org.simantics.project/src/org/simantics/project/management/PlatformUtil.java