Examples of fromStream()


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

      Class<?> clazz = Class.forName(className);

      // CREATE THE OBJECT BY INVOKING THE EMPTY CONSTRUCTOR
      OSerializableStream stream = (OSerializableStream) clazz.newInstance();

      return stream.fromStream(OArrays.copyOfRange(iStream, 4 + classNameSize, iStream.length));

    } catch (Exception e) {
      OLogManager.instance().error(this, "Error on unmarshalling content. Class: " + className, e, OSerializationException.class);
    }
    return null;
View Full Code Here

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

      } catch (Exception e) {
        OLogManager.instance().error(this, "Error on unmarshalling content. Class: " + className, e, OSerializationException.class);
      }
    }

    instance.fromStream(OBinaryProtocol.string2bytes(iStream.substring(pos + 1)));
    return instance;
  }

  /**
   * Serialize the class name size + class name + object content
View Full Code Here

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

      } catch (Exception e) {
        OLogManager.instance().error(this, "Error on unmarshalling content. Class: " + className, e, OSerializationException.class);
      }
    }

    instance.fromStream(OBase64Utils.decode(iStream.substring(pos + 1)));
    return instance;
  }

  /**
   * Serialize the class name size + class name + object content
View Full Code Here

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

    case CUSTOM:
      try {
        String className = readString(bytes);
        Class<?> clazz = Class.forName(className);
        OSerializableStream stream = (OSerializableStream) clazz.newInstance();
        stream.fromStream(readBinary(bytes));
        value = stream;
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
      break;
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.serializer.record.ORecordSerializer.fromStream()

    assertEquals(doc.fieldType("string"), OType.STRING);
    assertEquals(doc.fieldType("binary"), OType.BINARY);
    ORecordSerializer ser = ODatabaseDocumentTx.getDefaultSerializer();
    byte[] bytes = ser.toStream(doc, false);
    doc = new ODocument();
    ser.fromStream(bytes, doc, null);
    assertEquals(doc.fieldType("integer"), OType.INTEGER);
    assertEquals(doc.fieldType("string"), OType.STRING);
    assertEquals(doc.fieldType("binary"), OType.BINARY);
    assertEquals(doc.fieldType("link"), OType.LINK);
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.serializer.stream.OStreamSerializer.fromStream()

  protected Object valueFromStream(final int iIndex) throws IOException {
    final OStreamSerializer valueSerializer = ((OMVRBTreeMapProvider<K, V>) treeDataProvider).valueSerializer;
    if (valueSerializer instanceof OBinarySerializer)
      return ((OBinarySerializer<V>) valueSerializer).deserialize(buffer, serializedValues[iIndex]);

    return valueSerializer.fromStream(stream.getAsByteArray(serializedValues[iIndex]));
  }

  private byte[] convertIntoNewSerializationFormat(byte[] stream) throws IOException {
    final OMemoryStream oldStream = new OMemoryStream(stream);
View Full Code Here

Examples of com.orientechnologies.orient.core.type.tree.OMVRBTreeRIDSet.fromStream()

        if (iType == OType.EMBEDDEDLIST)
          coll = (Collection<?>) new ORecordLazyList().setStreamedContent(new StringBuilder(value));
        else {
          final OMVRBTreeRIDSet set = new OMVRBTreeRIDSet();
          set.setAutoConvertToRecord(false);
          set.fromStream(new StringBuilder(value));
          return set;
        }
      }
    } else
      coll = iType == OType.EMBEDDEDLIST ? new OTrackedList<Object>(iDocument) : new OTrackedSet<Object>(iDocument);
View Full Code Here

Examples of org.infinispan.commands.module.ExtendedModuleCommandFactory.fromStream()

               throw new CacheException("Unknown command id " + id + "!");
         }
      } else {
         ExtendedModuleCommandFactory mcf = (ExtendedModuleCommandFactory) commandFactories.get(id);
         if (mcf != null)
            return mcf.fromStream(id, parameters, cacheName);
         else
            throw new CacheException("Unknown command id " + id + "!");
      }
      command.setParameters(id, parameters);
      return command;
View Full Code Here

Examples of org.infinispan.commands.module.ExtendedModuleCommandFactory.fromStream()

               throw new CacheException("Unknown command id " + id + "!");
         }
      } else {
         ExtendedModuleCommandFactory mcf = (ExtendedModuleCommandFactory) commandFactories.get(id);
         if (mcf != null)
            return mcf.fromStream(id, parameters, cacheName);
         else
            throw new CacheException("Unknown command id " + id + "!");
      }
      command.setParameters(id, parameters);
      return command;
View Full Code Here

Examples of org.infinispan.commands.module.ExtendedModuleCommandFactory.fromStream()

               throw new CacheException("Unknown command id " + id + "!");
         }
      } else {
         ExtendedModuleCommandFactory mcf = (ExtendedModuleCommandFactory) commandFactories.get(id);
         if (mcf != null)
            return mcf.fromStream(id, parameters, cacheName);
         else
            throw new CacheException("Unknown command id " + id + "!");
      }
      command.setParameters(id, parameters);
      return command;
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.