Examples of ORecordBytes


Examples of com.orientechnologies.orient.core.record.impl.ORecordBytes

public class OHttpMultipartFileToRecordContentParser implements OHttpMultipartContentParser<ORID> {

  @Override
  public ORID parse(final OHttpRequest iRequest, final Map<String, String> headers, final OHttpMultipartContentInputStream in,
      ODatabaseRecord database) throws IOException {
    ORecordBytes record = new ORecordBytes(database);
    record.fromInputStream(in);
    record.save();
    return record.getIdentity();
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ORecordBytes

    final String rid = urlParts[2];

    iRequest.data.commandInfo = "Download";
    iRequest.data.commandDetail = rid;

    final ORecordBytes response;

    try {

      response = db.load(new ORecordId(rid));
      if (response != null) {
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ORecordBytes

        final ORecordStringable record = (ORecordStringable) iRecord;
        json.writeAttribute(indentLevel + 1, true, "value", record.value());

      } else if (iRecord instanceof ORecordBytes) {
        // BYTES
        final ORecordBytes record = (ORecordBytes) iRecord;
        json.writeAttribute(indentLevel + 1, true, "value", OBase64Utils.encodeBytes(record.toStream()));
      } else

        throw new OSerializationException("Error on marshalling record of type '" + iRecord.getClass()
            + "' to JSON. The record type can't be exported to JSON");
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ORecordBytes

public class ORecordSerializerRaw implements ORecordSerializer {
  public static final String  NAME  = "ORecordDocumentRaw";

  public ORecordInternal<?> fromStream(ODatabaseRecord iDatabase, byte[] iSource) {
    return new ORecordBytes(iDatabase, iSource);
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ORecordBytes

  public ORecordInternal<?> fromStream(ODatabaseRecord iDatabase, byte[] iSource) {
    return new ORecordBytes(iDatabase, iSource);
  }

  public ORecordInternal<?> fromStream(final ODatabaseRecord iDatabase, final byte[] iSource, final ORecordInternal<?> iRecord) {
    final ORecordBytes record = (ORecordBytes) iRecord;

    record.fromStream(iSource);
    record.reset(iSource);
    record.setDatabase(iDatabase);

    return record;
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ORecordBytes

public class ORecordSerializerRaw implements ORecordSerializer {
  public static final String  NAME  = "ORecordDocumentRaw";

  public ORecordInternal<?> fromStream(ODatabaseRecord iDatabase, byte[] iSource) {
    return new ORecordBytes(iDatabase, iSource);
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ORecordBytes

  public ORecordInternal<?> fromStream(ODatabaseRecord iDatabase, byte[] iSource) {
    return new ORecordBytes(iDatabase, iSource);
  }

  public ORecordInternal<?> fromStream(final ODatabaseRecord iDatabase, final byte[] iSource, final ORecordInternal<?> iRecord) {
    final ORecordBytes record = (ORecordBytes) iRecord;

    record.fromStream(iSource);
    record.reset(iSource);
    record.setDatabase(iDatabase);

    return record;
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ORecordBytes

  @Test
  public void testBasicCreateExternal() {
    database.open("admin", "admin");

    ORecordBytes record = new ORecordBytes(database, "This is a test".getBytes());
    record.save();
    rid = record.getIdentity();

    database.close();
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ORecordBytes

  @Test(dependsOnMethods = "testBasicCreateExternal")
  public void testBasicReadExternal() {
    database.open("admin", "admin");

    ORecordBytes record = database.load(rid);

    Assert.assertEquals("This is a test", new String(record.toStream()));

    database.close();
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ORecordBytes

  @Test(dependsOnMethods = "testBasicReadExternal")
  public void testMixedCreateExternal() {
    database.open("admin", "admin");

    ODocument doc = new ODocument(database);
    doc.field("binary", new ORecordBytes(database, "Binary data".getBytes()));

    doc.save();
    rid = doc.getIdentity();

    database.close();
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.