コード例 #1
0
        public void WriteData(AMFWriter writer, object data)
        {
            if(data is byte[])
                data = new ByteArray(data as byte[]);

            if(data is ByteArray)
            {
                writer.WriteByteArray(data as ByteArray);
            }
        }
コード例 #2
0
ファイル: AsyncMessage.cs プロジェクト: wzpyh/Client
		public override void WriteExternal(IDataOutput output)
		{
			base.WriteExternal(output);

			if (CorrelationIdBytes == null)
				CorrelationIdBytes = RtmpUtil.ToByteArray(CorrelationId);

			int flag = 0;
			if (CorrelationId != null && CorrelationIdBytes == null)
				flag |= CORRELATION_ID_FLAG;
			if (CorrelationIdBytes != null)
				flag |= CORRELATION_ID_BYTES_FLAG;

			output.WriteByte((byte)flag);

			if (CorrelationId != null && CorrelationIdBytes == null)
				output.WriteObject(CorrelationId);
			if (CorrelationIdBytes != null)
				output.WriteObject(CorrelationIdBytes);
		}
コード例 #3
0
 /// <summary>
 /// Reads all available data from the byte stream. The bytes are read into the ByteArray object specified by the bytes parameter.
 /// </summary>
 /// <param name="bytes">The ByteArray object to read data into.</param>
 public void ReadBytes(ByteArray bytes)
 {
     ReadBytes(bytes, 0, 0);
 }