Package com.esotericsoftware.kryo.io

Examples of com.esotericsoftware.kryo.io.Input.readBoolean()


      write.writeBoolean(false);
    }

    Input read = new UnsafeMemoryInput(write.toBytes());
    for (int i = 0; i < 100; i++) {
      assertEquals(true, read.readBoolean());
      assertEquals(false, read.readBoolean());
    }
  }

  public void testChars () throws IOException {
View Full Code Here


    }

    Input read = new UnsafeMemoryInput(write.toBytes());
    for (int i = 0; i < 100; i++) {
      assertEquals(true, read.readBoolean());
      assertEquals(false, read.readBoolean());
    }
  }

  public void testChars () throws IOException {
    runCharTest(new UnsafeMemoryOutput(4096));
View Full Code Here

      write.writeBoolean(false);
    }

    Input read = new UnsafeInput(write.toBytes());
    for (int i = 0; i < 100; i++) {
      assertEquals(true, read.readBoolean());
      assertEquals(false, read.readBoolean());
    }
  }

  public void testChars () throws IOException {
View Full Code Here

    }

    Input read = new UnsafeInput(write.toBytes());
    for (int i = 0; i < 100; i++) {
      assertEquals(true, read.readBoolean());
      assertEquals(false, read.readBoolean());
    }
  }

  public void testChars () throws IOException {
    runCharTest(new UnsafeOutput(4096));
View Full Code Here

      write.writeBoolean(false);
    }

    Input read = new Input(write.toBytes());
    for (int i = 0; i < 100; i++) {
      assertEquals(true, read.readBoolean());
      assertEquals(false, read.readBoolean());
    }
  }

  public void testChars () throws IOException {
View Full Code Here

    }

    Input read = new Input(write.toBytes());
    for (int i = 0; i < 100; i++) {
      assertEquals(true, read.readBoolean());
      assertEquals(false, read.readBoolean());
    }
  }

  public void testChars () throws IOException {
    runCharTest(new Output(4096));
View Full Code Here

        } catch (Exception ex) {
            throw new IOException("Could not instantiate BatchGraph wrapper", ex);
        }

        try (final Output output = new Output(new FileOutputStream(tempFile))) {
            final boolean supportedMemory = input.readBoolean();
            if (supportedMemory) {
                // if the graph that serialized the data supported sideEffects then the sideEffects needs to be read
                // to advance the reader forward.  if the graph being read into doesn't support the sideEffects
                // then we just setting the data to sideEffects.
                final Map<String, Object> memMap = (Map<String, Object>) kryo.readObject(input, HashMap.class);
View Full Code Here

                    final Graph.Variables variables = graphToWriteTo.variables();
                    memMap.forEach(variables::set);
                }
            }

            final boolean hasSomeVertices = input.readBoolean();
            if (hasSomeVertices) {
                while (!input.eof()) {
                    final List<Object> vertexArgs = new ArrayList<>();
                    final DetachedVertex current = (DetachedVertex) kryo.readClassAndObject(input);
                    appendToArgList(vertexArgs, T.id, current.id());
View Full Code Here

                    final Vertex v = graph.addVertex(vertexArgs.toArray());
                    current.iterators().propertyIterator().forEachRemaining(p -> createVertexProperty(graphToWriteTo, v, p, false));
                    current.iterators().hiddenPropertyIterator().forEachRemaining(p -> createVertexProperty(graphToWriteTo, v, p, true));

                    // the gio file should have been written with a direction specified
                    final boolean hasDirectionSpecified = input.readBoolean();
                    final Direction directionInStream = kryo.readObject(input, Direction.class);
                    final Direction directionOfEdgeBatch = kryo.readObject(input, Direction.class);

                    // graph serialization requires that a direction be specified in the stream and that the
                    // direction of the edges be OUT
View Full Code Here

                    if (!hasDirectionSpecified || directionInStream != Direction.OUT || directionOfEdgeBatch != Direction.OUT)
                        throw new IllegalStateException(String.format("Stream must specify edge direction and that direction must be %s", Direction.OUT));

                    // if there are edges then read them to end and write to temp, otherwise read what should be
                    // the vertex terminator
                    if (!input.readBoolean())
                        kryo.readClassAndObject(input);
                    else
                        readToEndOfEdgesAndWriteToTemp(input, output);
                }
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.