Examples of OMemoryStream


Examples of com.orientechnologies.orient.core.serialization.OMemoryStream

    }
  }

  public OSerializableStream fromStream(final byte[] iStream) throws OSerializationException {
    try {
      final OMemoryStream stream = new OMemoryStream(iStream);
      type = stream.getAsByte();
      final ORecordId rid = new ORecordId().fromStream(stream);

      switch (type) {
      case CREATED:
      case UPDATED:
        record = Orient.instance().getRecordFactoryManager().newInstance(stream.getAsByte());
        ORecordInternal.fill((ORecord) record, rid, OVersionFactory.instance().createVersion(), stream.getAsByteArray(), true);
        break;
      }

      return this;
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.OMemoryStream

    this.text = iText;
    return this;
  }

  public OSerializableStream fromStream(byte[] iStream) throws OSerializationException {
    final OMemoryStream buffer = new OMemoryStream(iStream);
    fromStream(buffer);
    return this;
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.OMemoryStream

    fromStream(buffer);
    return this;
  }

  public byte[] toStream() throws OSerializationException {
    final OMemoryStream buffer = new OMemoryStream();
    return toStream(buffer);
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.OMemoryStream

  protected WeakReference<OIdentityChangedListener> identityChangedListener;

  public OMVRBTreeEntryDataProviderAbstract(final OMVRBTreeProviderAbstract<K, V> iTreeDataProvider, final int iFixedSize) {
    this(iTreeDataProvider, null);
    pageSize = treeDataProvider.getDefaultPageSize();
    stream = new OMemoryStream(iFixedSize);
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.OMemoryStream

  public String toString() {
    return "sql." + text;
  }

  public OSerializableStream fromStream(final byte[] iStream) throws OSerializationException {
    final OMemoryStream buffer = new OMemoryStream(iStream);

    queryFromStream(buffer);

    return this;
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.OMemoryStream

  public byte[] toStream() throws OSerializationException {
    return queryToStream().toByteArray();
  }

  protected OMemoryStream queryToStream() {
    final OMemoryStream buffer = new OMemoryStream();

    buffer.setUtf8(text); // TEXT AS STRING
    buffer.set(limit); // LIMIT AS INTEGER
    buffer.setUtf8(fetchPlan != null ? fetchPlan : ""); // FETCH PLAN IN FORM OF STRING (to know more goto:
    // http://code.google.com/p/orient/wiki/FetchingStrategies)

    buffer.set(serializeQueryParameters(parameters));

    return buffer;
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.OMemoryStream

    } catch (IOException e) {
      e.printStackTrace();
    }
    System.out.println("Data Output Stream " + (System.currentTimeMillis() - time));
    time = System.currentTimeMillis();
    OMemoryStream mou = new OMemoryStream();
    for (int i = 0; i < 1000000; i++) {
      mou.setCustom("adfsdfsdfadfsdfsdfadfsdfsdfadfsdfsdf");
      mou.set(32);
      mou.set(32l);
      mou.set((byte) 32);
    }

    System.out.println("OMemoryStream " + (System.currentTimeMillis() - time));

    System.out.println("" + s.toByteArray().length + " " + mou.toByteArray().length);

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