Package org.apache.mina.common

Examples of org.apache.mina.common.ByteBuffer.fill()


        for (int i = 0; i < _chunkCount; i++)
        {
            ByteBuffer buf = ByteBuffer.allocate(_chunkSize, false);
            byte check = (byte) (i % 128);
            buf.put(check);
            buf.fill((byte) 88, buf.remaining());
            buf.flip();

            _session.write(buf);
        }
View Full Code Here


      ByteBuffer out = ByteBuffer.allocate((Constants.HANDSHAKE_SIZE*2)+1);
      out.put((byte)0x03);
      // TODO: the first four bytes of the handshake reply seem to be the
      //       server uptime - send something better here...
      out.putInt(0x01);
      out.fill((byte)0x00,Constants.HANDSHAKE_SIZE-4);
      out.put(in);
      out.flip();
      // Skip first 8 bytes when comparing the handshake, they seem to
      // be changed when connecting from a Mac client.
      rtmp.setHandshake(out, 9, Constants.HANDSHAKE_SIZE-8);
View Full Code Here

      if (log.isDebugEnabled()){
        log.debug("Handshake 1st phase");
      }
      ByteBuffer out = ByteBuffer.allocate(Constants.HANDSHAKE_SIZE+1);
      out.put((byte)0x03);
      out.fill((byte)0x00,Constants.HANDSHAKE_SIZE);
      out.flip();
      session.write(out);
    } else {
      final RTMPMinaConnection conn = (RTMPMinaConnection) session.getAttachment();
      handler.connectionOpened(conn, rtmp);
View Full Code Here

    out.put((byte) 0x03);
    // TODO: the first four bytes of the handshake reply seem to be the
    //       server uptime - send something better here...
    out.putInt(0x01);
    out.fill((byte) 0x00, Constants.HANDSHAKE_SIZE-4);
    out.put(in).flip();
    // Skip first 8 bytes when comparing the handshake, they seem to
    // be changed when connecting from a Mac client.
    rtmp.setHandshake(out, 9, Constants.HANDSHAKE_SIZE-8);
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.