Package com.orientechnologies.orient.core.serialization

Examples of com.orientechnologies.orient.core.serialization.OMemoryStream.copy()


    final OMemoryStream memoryStream = new OMemoryStream();
    ObjectOutputStream out = new ObjectOutputStream(memoryStream);
    out.writeObject(beforeSerialization);
    out.close();

    final ObjectInputStream input = new ObjectInputStream(new OMemoryInputStream(memoryStream.copy()));
    @SuppressWarnings("unchecked")
    final List<String> afterSerialization = (List<String>) input.readObject();

    Assert.assertEquals(afterSerialization.size(), beforeSerialization.size(), "List size");
    for (int i = 0; i < afterSerialization.size(); i++) {
View Full Code Here


    final OMemoryStream memoryStream = new OMemoryStream();
    final ObjectOutputStream out = new ObjectOutputStream(memoryStream);
    out.writeObject(beforeSerialization);
    out.close();

    final ObjectInputStream input = new ObjectInputStream(new OMemoryInputStream(memoryStream.copy()));
    @SuppressWarnings("unchecked")
    final Map<Object, String> afterSerialization = (Map<Object, String>) input.readObject();

    Assert.assertEquals(afterSerialization.size(), beforeSerialization.size(), "Map size");
    for (int i = 0; i < afterSerialization.size(); i++) {
View Full Code Here

    final OMemoryStream memoryStream = new OMemoryStream();
    ObjectOutputStream out = new ObjectOutputStream(memoryStream);
    out.writeObject(beforeSerialization);
    out.close();

    final ObjectInputStream input = new ObjectInputStream(new OMemoryInputStream(memoryStream.copy()));
    @SuppressWarnings("unchecked")
    final Set<String> afterSerialization = (Set<String>) input.readObject();

    Assert.assertEquals(afterSerialization.size(), beforeSerialization.size(), "Set size");
    Assert.assertTrue(beforeSerialization.containsAll(afterSerialization));
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.