Examples of ORecordBytes


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

      out.printf("Flat - record id: %s   v.%d\n", rec.getIdentity().toString(), rec.getVersion());
      out.println("--------------------------------------------------");
      out.print(rec.value());

    } 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.ORecordBytes

      out.printf("Flat - record id: %s   v.%d\n", rec.getIdentity().toString(), rec.getVersion());
      out.println("--------------------------------------------------");
      out.print(rec.value());

    } 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.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

      }

      fileDocument = null;
    } else {
      if (fileRID != null) {
        ORecordBytes file = new ORecordBytes(database, fileRID);
        database.delete(file);
      }
      sendTextContent(iRequest, OHttpUtils.STATUS_INVALIDMETHOD_CODE, "Document template cannot be null", null,
          OHttpUtils.CONTENT_TEXT_PLAIN, "Document template cannot be null");
    }
View Full Code Here

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

  public OKVDatabase(final String iURL) {
    super(iURL);
  }

  public OMVRBTreeDatabase<String, String> getBucket(final ODatabaseRecordAbstract iDb, final String iBucket) throws IOException {
    final ORecordBytes rec = (ORecordBytes) iDb.getDictionary().get(iBucket);

    OMVRBTreeDatabase<String, String> bucketTree = null;

    if (rec != null) {
      bucketTree = new OMVRBTreeDatabase<String, String>(iDb, rec.getIdentity());
      bucketTree.load();
    }

    if (bucketTree == null) {
      // CREATE THE BUCKET
View Full Code Here

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

        return new ORecordFlat();
      }
    });
    declareRecordType(ORecordBytes.RECORD_TYPE, "bytes", ORecordBytes.class, new ORecordFactory() {
      public ORecord newRecord() {
        return new ORecordBytes();
      }
    });
  }
View Full Code Here

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 {
    final ORecordBytes record = new ORecordBytes();
    record.fromInputStream(in);
    record.save();
    return record.getIdentity();
  }
View Full Code Here

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

  @OAfterDeserialization
  public void fromStream(final ODocument iDocument) {
    initialized = true;
    if (iDocument.containsField("externalPhoto")) {
      // READ THE PHOTO FROM AN EXTERNAL RECORD AS PURE BINARY
      ORecordBytes extRecord = iDocument.field("externalPhoto");
      photo = extRecord.toStream();
    }
  }
View Full Code Here

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

  @OBeforeSerialization
  public void toStream(final ODocument iDocument) {
    if (thumbnail != null) {
      // WRITE THE PHOTO IN AN EXTERNAL RECORD AS PURE BINARY
      ORecordBytes externalPhoto = new ORecordBytes(thumbnail);
      iDocument.field("externalPhoto", externalPhoto);
    }
  }
View Full Code Here

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

      message("\nFlat - record id: %s   v.%s", rec.getIdentity().toString(), rec.getRecordVersion().toString());
      message("\n--------------------------------------------------");
      message(rec.value());

    } else if (currentRecord instanceof ORecordBytes) {
      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
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.