Examples of toStream()


Examples of com.orientechnologies.orient.core.record.impl.ORecordBytes.toStream()

      record.save();
      database.commit();

      record.reload();
      Assert.assertEquals(record.getRecordVersion().getCounter(), v1 + 1);
      Assert.assertTrue(new String(record.toStream()).contains("second"));
    } finally {
      database.close();
    }
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ORecordBytes.toStream()

      ODatabaseRecordThreadLocal.INSTANCE.set(db2);

      ORecordBytes record2 = db2.load(record1.getIdentity(), "*:-1", true);
      Assert.assertEquals(record2.getRecordVersion().getCounter(), v1 + 1);
      Assert.assertTrue(new String(record2.toStream()).contains("second"));

    } finally {

      database.close();
      db2.close();
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ORecordFlat.toStream()

    } else if (currentRecord instanceof ORecordBytes) {
      ORecordBytes rec = (ORecordBytes) currentRecord;
      out.println("--------------------------------------------------");
      out.printf("Flat - record id: %s   v.%d\n", rec.getIdentity().toString(), rec.getVersion());
      out.println("--------------------------------------------------");
      byte[] value = rec.toStream();
      for (int i = 0; i < Array.getLength(value); ++i) {
        out.printf("%03d", Array.getByte(value, i));
      }

    } else {
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ORecordFlat.toStream()

    } else if (currentRecord instanceof ORecordBytes) {
      ORecordBytes rec = (ORecordBytes) currentRecord;
      out.println("--------------------------------------------------");
      out.printf("Flat - record id: %s   v.%d\n", rec.getIdentity().toString(), rec.getVersion());
      out.println("--------------------------------------------------");
      byte[] value = rec.toStream();
      for (int i = 0; i < Array.getLength(value); ++i) {
        out.printf("%03d", Array.getByte(value, i));
      }

    } else {
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ORecordFlat.toStream()

    } else if (currentRecord instanceof ORecordBytes) {
      ORecordBytes rec = (ORecordBytes) currentRecord;
      out.println("--------------------------------------------------");
      out.printf("Flat - record id: %s   v.%d\n", rec.getIdentity().toString(), rec.getVersion());
      out.println("--------------------------------------------------");
      byte[] value = rec.toStream();
      for (int i = 0; i < Array.getLength(value); ++i) {
        out.printf("%03d", Array.getByte(value, i));
      }

    } else {
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ORecordFlat.toStream()

    } else if (currentRecord instanceof ORecordBytes) {
      ORecordBytes rec = (ORecordBytes) currentRecord;
      out.println("--------------------------------------------------");
      out.printf("Flat - record id: %s   v.%d\n", rec.getIdentity().toString(), rec.getVersion());
      out.println("--------------------------------------------------");
      byte[] value = rec.toStream();
      for (int i = 0; i < Array.getLength(value); ++i) {
        out.printf("%03d", Array.getByte(value, i));
      }

    } else {
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ORecordFlat.toStream()

      ORecordBytes rec = (ORecordBytes) currentRecord;
      message("\n--------------------------------------------------");
      message("\nBytes - record id: %s   v.%s", rec.getIdentity().toString(), rec.getRecordVersion().toString());
      message("\n--------------------------------------------------");

      final byte[] value = rec.toStream();
      final int max = Math.min(Integer.parseInt(properties.get("maxBinaryDisplay")), Array.getLength(value));
      for (int i = 0; i < max; ++i) {
        message("%03d", Array.getByte(value, i));
      }
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.OSerializableStream.toStream()

        throw new OSerializationException("Can't serialize the object since it's not implements the OSerializableStream interface");

      OSerializableStream stream = (OSerializableStream) iValue;
      iOutput.append(iValue.getClass().getName());
      iOutput.append(OStreamSerializerHelper.SEPARATOR);
      iOutput.append(OBinaryProtocol.bytes2string(stream.toStream()));
    }
    return iOutput;
  }

  public String getName() {
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.OSerializableStream.toStream()

      if (!(iValue instanceof OSerializableStream))
        throw new OSerializationException("Can't serialize the object since it's not implements the OSerializableStream interface");

      iOutput.append(iValue.getClass().getName());
      iOutput.append(OStreamSerializerHelper.SEPARATOR);
      iOutput.append(OBinaryProtocol.bytes2string(stream.toStream()));
    }
    return iOutput;
  }

  public String getName() {
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.OSerializableStream.toStream()

    // SERIALIZE THE CLASS NAME
    byte[] className = OBinaryProtocol.string2bytes(iObject.getClass().getName());
   
    // SERIALIZE THE OBJECT CONTENT
    byte[] objectContent = stream.toStream();

    byte[] result = new byte[4 + className.length + objectContent.length];

    // COPY THE CLASS NAME SIZE + CLASS NAME + OBJECT CONTENT
    System.arraycopy(OBinaryProtocol.int2bytes(className.length), 0, result, 0, 4);
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.