X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.graph.db%2Fsrc%2Forg%2Fsimantics%2Fgraph%2Fdb%2FStreamingTransferableGraphFileReader.java;h=8c82c23bc69bb8a8f37ff6855e577ea050a2cb16;hp=68a94e304581f71d55d1c57d9e3220a5da6bac3c;hb=59cab457bcc89618e8557235fd65eaecbe583592;hpb=85eac68ed3cae0996c54b536a2f2a49abf8fc303 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 68a94e304..8c82c23bc 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 @@ -5,7 +5,6 @@ import java.io.DataInputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.nio.ByteBuffer; import java.nio.channels.ReadableByteChannel; import java.util.ArrayList; import java.util.Arrays; @@ -25,39 +24,13 @@ import org.simantics.graph.representation.ByteFileReader; import org.simantics.graph.representation.Extensions; import org.simantics.graph.representation.External; import org.simantics.graph.representation.Identity; +import org.simantics.graph.representation.InputChannel; import org.simantics.graph.representation.Internal; import org.simantics.graph.representation.Root; import org.simantics.graph.representation.Value; final public class StreamingTransferableGraphFileReader extends ByteFileReader { - - final static class InputChannel implements ReadableByteChannel { - - final private InputStream stream; - - public InputChannel(InputStream stream) { - this.stream = stream; - } - - @Override - public boolean isOpen() { - return true; - } - - @Override - public void close() throws IOException { - } - - @Override - public int read(ByteBuffer dst) throws IOException { - int pos = dst.position(); - int limit = dst.limit(); - int i=stream.read(dst.array(), pos, limit-pos); - return i; - } - - } private static boolean init = true;