Package org.red5.io.object

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


     * @throws IOException       I/O exception
     */
  @SuppressWarnings("unchecked")
    public void deserialize(Input input) throws IOException {
    Deserializer deserializer = new Deserializer();
    setAttributes(deserializer.deserialize(input, Map.class));
  }

    /**
     * Load data from another persistent store
     *
 
View Full Code Here

  /** {@inheritDoc} */
    @SuppressWarnings("unchecked")
    public void deserialize(Input input) throws IOException {
    Deserializer deserializer = new Deserializer();
    name = deserializer.deserialize(input, String.class);
    persistentSO = persistent = true;
    super.setAttributes(deserializer.deserialize(input, Map.class));
    ownerMessage.setName(name);
    ownerMessage.setIsPersistent(true);
  }
View Full Code Here

    @SuppressWarnings("unchecked")
    public void deserialize(Input input) throws IOException {
    Deserializer deserializer = new Deserializer();
    name = deserializer.deserialize(input, String.class);
    persistentSO = persistent = true;
    super.setAttributes(deserializer.deserialize(input, Map.class));
    ownerMessage.setName(name);
    ownerMessage.setIsPersistent(true);
  }

  /** {@inheritDoc} */
 
View Full Code Here

      String name = Input.getString(in);
      @SuppressWarnings("unused")
      boolean required = (in.get() == 0x01);
      @SuppressWarnings("unused")
      int len = in.getInt();
      Object value = deserializer.deserialize(input, Object.class);

      // XXX: this is pretty much untested!!!
      if (name.equals(RemotingHeader.APPEND_TO_GATEWAY_URL)) {
        // Append string to gateway url
        appendToUrl = (String) value;
View Full Code Here

    String nullString = input.getString(); // expect
    // "null"

    // Read return value
    Deserializer deserializer = new Deserializer();
    return deserializer.deserialize(input, Object.class);
  }

  /**
   * Send authentication data with each remoting request.
   *
 
View Full Code Here

    Map<String, Object> result = new HashMap<String, Object>();
    for (int i = 0; i < count; i++) {
      String name = org.red5.io.amf.Input.getString(in);
      boolean required = in.get() == 0x01;
      int size = in.getInt();
      Object value = deserializer.deserialize(input, Object.class);
      if (log.isDebugEnabled()) {
        log.debug("Header: {} Required: {} Size: {} Value: {}", new Object[]{name, required, size, value});
      }
      result.put(name, value);
    }
View Full Code Here

              }
              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

              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);
            }
          } catch (ClassNotFoundException cnfe) {
            log.error("Unknown class {}", className);
            return null;
          } catch (IllegalAccessException iae) {
View Full Code Here

          String resultClass = result.getClass().getName();
          if (!resultClass.equals(className)) {
            log.error("The classes differ: {} != {}", resultClass, className);
            return null;
          }
          result.deserialize(in);
        }
      } finally {
        buf.free();
        buf = null;
      }
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.