Package org.red5.io.object

Examples of org.red5.io.object.Deserializer


*/
public class SimpleClient implements IRTMPHandler {
 
  public static void main(String[] args) {
    RTMPCodecFactory codecFactory=new RTMPCodecFactory();
    codecFactory.setDeserializer(new Deserializer());
    codecFactory.setSerializer(new Serializer());
    codecFactory.init();
   
    RTMPMinaIoHandler ioHandler=new RTMPMinaIoHandler();
    ioHandler.setCodecFactory(codecFactory);
View Full Code Here


    private Map<String, ClientSharedObject> sharedObjects = new HashMap<String, ClientSharedObject>();

  /** Constructs a new RTMPClient. */
    public RTMPClient() {
    RTMPCodecFactory codecFactory = new RTMPCodecFactory();
    codecFactory.setDeserializer(new Deserializer());
    codecFactory.setSerializer(new Serializer());
    codecFactory.init();
   
    ioHandler = new RTMPMinaIoHandler();
    ioHandler.setCodecFactory(codecFactory);
View Full Code Here

  // TODO need to fix
  public MetaData readMetaData(ByteBuffer buffer) {
    MetaData retMeta = new MetaData();
    Input input = new Input(buffer);
    if (deserializer == null) {
        deserializer = new Deserializer();
    }
    @SuppressWarnings("unused")
    String metaType = deserializer.deserialize(input, String.class);
    Map m = deserializer.deserialize(input, Map.class);
    retMeta.putAll(m);
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

    // is
    // not
    // yet
    // implemented
    int count = in.getUnsignedShort();
    Deserializer deserializer = new Deserializer();
    Input input = new Input(in);
    for (int i = 0; i < count; i++) {
      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

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

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

    if (count == 0) {
      // No headers present
      return Collections.EMPTY_MAP;
    }
   
    Deserializer deserializer = new Deserializer();
    Input input;
    if (version == 3) {
      input = new org.red5.io.amf3.Input(in);
    } else {
      input = new org.red5.io.amf.Input(in);
    }
    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

  /**
   * Create internal objects used for reading and writing.
   */
  protected void prepareIO() {
    dataInput = new DataInput(new Input(data), new Deserializer());
    dataOutput = new DataOutput(new Output(data), new Serializer());
  }
View Full Code Here

    }
    if (audioCodecId != null) {
      params.put("audiocodecid", audioCodecId.intValue());
    }
    params.put("canSeekToEnd", true);
    out.writeMap(params, new Serializer());
    buf.flip();

    if (fileMetaSize == 0) {
      fileMetaSize = buf.limit();
    }
View Full Code Here

    public void onStreamEvent( Notify notify ) {

        logger.debug( "onStreamEvent " + notify );

        ObjectMap map = (ObjectMap) notify.getCall().getArguments()[ 0 ];
        String code = (String) map.get( "code" );

        if ( StatusCodes.NS_PUBLISH_START.equals( code ) ) {
            logger.debug( "onStreamEvent Publish start" );
            startPublish = true;
        }
View Full Code Here

TOP

Related Classes of org.red5.io.object.Deserializer

Copyright © 2018 www.massapicom. 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.