Examples of deserialize()


Examples of org.qi4j.api.value.ValueSerialization.deserialize()

        try
        {
            // @TODO there is probably a more efficient way to do this
            ValueSerialization valueSerialization = currentModule.valueSerialization();
            String serialized = valueSerialization.serialize( prototype );
            value = valueSerialization.deserialize( valueModel.valueType(), serialized);
        }
        catch( ValueSerializationException e )
        {
            throw new IllegalStateException( "Could not serialize-copy Value", e );
        }
View Full Code Here

Examples of org.red5.io.object.Deserializer.deserialize()

      try {
        ServletUtils.copy(input, buf.asOutputStream());
        buf.flip();
        Input in = new Input(buf);
        Deserializer deserializer = new Deserializer();
        String className = deserializer.deserialize(in, String.class);
        if (result == null) {
          // We need to create the object first
          try {
            Class<?> theClass = Class.forName(className);
            Constructor<?> constructor = null;
View Full Code Here

Examples of org.red5.server.api.persistence.IPersistable.deserialize()

              }
              result = (IPersistable) constructor.newInstance(in);
            } catch (NoSuchMethodException err) {
              // no valid constructor found, use empty constructor
              result = (IPersistable) theClass.newInstance();
              result.deserialize(in);
            } catch (InvocationTargetException err) {
              // error while invoking found constructor, use empty constructor
              result = (IPersistable) theClass.newInstance();
              result.deserialize(in);
            }
View Full Code Here

Examples of org.rhq.test.ObjectCollectionSerializer.deserialize()

    public void testCanDeserialize() throws Exception {
        ObjectCollectionSerializer serializer = new ObjectCollectionSerializer();

        ByteArrayInputStream in = new ByteArrayInputStream(getSerializedTestObjectTree());

        List<?> objects = serializer.deserialize(in);

        assert objects != null && objects.equals(getTestObjectTree()) : "The deserialized objects don't match the expected results";
    }
}
View Full Code Here

Examples of org.spout.api.generator.biome.BiomeManager.deserialize()

  @Override
  public BiomeManager generateBiomes(int chunkX, int chunkZ, World world) {
    final BiomeManager biomeManager = new Simple2DBiomeManager(chunkX, chunkZ);
    final byte[] biomeData = new byte[Chunk.BLOCKS.AREA];
    Arrays.fill(biomeData, (byte) biome.getId());
    biomeManager.deserialize(biomeData);
    return biomeManager;
  }
}
View Full Code Here

Examples of org.spout.api.generator.biome.Simple2DBiomeManager.deserialize()

  @Override
  public BiomeManager generateBiomes(int chunkX, int chunkZ, World world) {
    final BiomeManager biomeManager = new Simple2DBiomeManager(chunkX, chunkZ);
    final byte[] biomeData = new byte[Chunk.BLOCKS.AREA];
    Arrays.fill(biomeData, (byte) biome.getId());
    biomeManager.deserialize(biomeData);
    return biomeManager;
  }
}
View Full Code Here

Examples of org.switchyard.serial.Serializer.deserialize()

public final class RemoteMessageTest {

    private <T> T serDeser(T object, Class<T> clazz) throws Exception {
        Serializer ser = SerializerFactory.create(FormatType.JSON, null, true);
        byte[] bytes = ser.serialize(object, clazz);
        return ser.deserialize(bytes, clazz);
    }

    @Test
    public void testDOMProperty() throws Exception {
        final String expectedXML = "<one number=\"1\"><two number=\"2\"/></one>";
View Full Code Here

Examples of org.terasology.persistence.serializers.EntitySerializer.deserialize()

                idMap.put(metadata.getType(), i);
            }
        }
        serializer.setComponentIdMapping(idMap);
        for (EntityData.Entity entity : store.getEntityList()) {
            serializer.deserialize(entity);
        }
        EntityRefTypeHandler.setReferenceInterceptor(null);

        Map<String, EntityRef> namedEntities = Maps.newHashMap();
        for (int i = 0; i < store.getEntityNameCount() && i < store.getEntityNamedCount(); ++i) {
View Full Code Here

Examples of org.terasology.persistence.serializers.PrefabSerializer.deserialize()

                    EntityData.Prefab delta = EntityDataJSONFormat.readPrefab(deltaReader);
                    deltaData.add(delta);
                }
            }
            PrefabSerializer serializer = new PrefabSerializer(entityManager.getComponentLibrary(), entityManager.getTypeSerializerLibrary());
            return serializer.deserialize(prefabData, deltaData);
        }
        return null;
    }
}
View Full Code Here

Examples of org.terasology.persistence.typeHandling.TypeHandler.deserialize()

            T result = clazz.newInstance();
            for (Map.Entry<String, PersistedData> entry : data.getAsValueMap().entrySet()) {
                FieldMetadata fieldInfo = fieldByName.get(UriUtil.normalise(entry.getKey()));
                if (fieldInfo != null) {
                    TypeHandler handler = mappedFields.get(fieldInfo);
                    Object val = handler.deserialize(entry.getValue(), context);
                    fieldInfo.setValue(result, val);
                }
            }
            return result;
        } catch (Exception e) {
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.