Examples of Derialize()


Examples of com.bj58.spat.gaea.serializer.serializer.IGaeaSerializer.Derialize()

            if (ptype == null) {
                throw new ClassNotFoundException("Cannot find class with typId,target class: " + f.getType().getName() + ",typeId:" + ptypeId);
            }
            if (IGaeaSerializer.class.isAssignableFrom(ptype)) {
                IGaeaSerializer value = (IGaeaSerializer) ptype.newInstance();
                value.Derialize(inStream);
                f.set(obj, value);
            } else {
                Object value = SerializerFactory.GetSerializer(ptype).ReadObject(inStream, f.getType());
                f.set(obj, value);
            }
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.serializer.IGaeaSerializer.Derialize()

        try {
            stream = new GaeaInStream(buffer);
            stream.Encoder = _Encoder;
            if (ClassHelper.InterfaceOf(type, IGaeaSerializer.class)) {
                IGaeaSerializer obj = (IGaeaSerializer) type.newInstance();
                obj.Derialize(stream);
                return obj;
            }
            return SerializerFactory.GetSerializer(type).ReadObject(stream, type);
        } finally {
            if (stream != null) {
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.serializer.Serializer.Derialize()

    user.setState(1);

    Serializer serializer = new Serializer();
    byte[] buffer = serializer.Serialize(user);
    assertNotNull(buffer);
    Object obj = serializer.Derialize(buffer, SimpleClass.class);
    Object expect = obj;
    assertNotNull(expect);
  }
}
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.serializer.Serializer.Derialize()

  public void testByte() throws Exception {
    Serializer serializer = new Serializer();
    Byte[] b = null;
    byte[] buffer = serializer.Serialize(b);

    Object obj1 = serializer.Derialize(buffer, Byte[].class);

    Short[] s = new Short[] { 1, 2, 3 };
    byte[] bs = serializer.Serialize(s);

    Map<Byte, Object> map = new HashMap<Byte, Object>();
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.serializer.Serializer.Derialize()

    map.put((byte) 3, s);
    map.put((byte) 4, 123);
    map.put((byte) 5, null);

    byte[] buf3 = serializer.Serialize(map);
    Map<Byte, Object> obj3 = (Map<Byte, Object>) serializer.Derialize(buf3,
        Map.class);
    System.out.println(obj3.get(5));
  }

  /**
 
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.serializer.Serializer.Derialize()

    SimpleClass sc = SimpleClass.Get();
    Object data = sc;
    Serializer serializer = new Serializer();
    byte[] buffer = serializer.Serialize(data);
    assertNotNull(buffer);
    Object obj = serializer.Derialize(buffer, SimpleClass.class);

    Object expect = obj;
    assertNotNull(expect);
  }
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.serializer.Serializer.Derialize()

    List<SimpleClass> scs = new ArrayList<SimpleClass>();
    SimpleClass sc = SimpleClass.Get();
    scs.add(sc);
    scs.add(sc);
    byte[] buffer = serializer.Serialize(scs);
    Object obj = serializer.Derialize(buffer, ArrayList.class);
    List<SimpleClass> scs2 = (List<SimpleClass>) obj;
    assertNotNull(scs2);
    assertTrue(scs2.get(0) == scs2.get(1));
  }
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.serializer.Serializer.Derialize()

  @Test
  public void TesteInt32() throws Exception {
    Serializer serializer = new Serializer();
    byte[] buffer = serializer.Serialize(123);
    assertNotNull(buffer);
    int num = (Integer) serializer.Derialize(buffer, Integer.class);
    assertEquals(123, num);
  }

  @Test
  public void TestDate() throws Exception {
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.serializer.Serializer.Derialize()

  public void TestDate() throws Exception {
    Serializer serializer = new Serializer();
    Object data = new Date();
    byte[] buffer = serializer.Serialize(data);
    assertNotNull(buffer);
    Object obj = serializer.Derialize(buffer, Date.class);
    Object expect = data;
    assertEquals(expect, obj);
  }

  @Test
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.serializer.Serializer.Derialize()

  public void TestInt() throws Exception {
    Serializer serializer = new Serializer();
    Object data = (int) 32;
    byte[] buffer = serializer.Serialize(data);
    assertNotNull(buffer);
    Object obj = serializer.Derialize(buffer, int.class);
    Object expect = data;
    assertEquals(expect, obj);
  }

  @Test
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.