當前位置: 首頁>>代碼示例>>C#>>正文


C# AMFReader.ReadUTF方法代碼示例

本文整理匯總了C#中AMFReader.ReadUTF方法的典型用法代碼示例。如果您正苦於以下問題:C# AMFReader.ReadUTF方法的具體用法?C# AMFReader.ReadUTF怎麽用?C# AMFReader.ReadUTF使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AMFReader的用法示例。


在下文中一共展示了AMFReader.ReadUTF方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Read

		public static DsoAmfBody Read(AMFReader reader, bool isAmf3) {
			reader.Reset();

			ushort targetUriLen = reader.ReadUInt16();
			string targetUri = reader.ReadUTF(targetUriLen); // When the message holds a response from a remote endpoint, the target URI specifies which method on the local client (i.e. reader request originator) should be invoked to handle the response.
			ushort responseUriLen = reader.ReadUInt16();
			string responseUri = reader.ReadUTF(responseUriLen); // The response's target URI is set to the request's response URI with an '/onResult' suffix to denote a success or an '/onStatus' suffix to denote a failure.

			long dataLen = reader.ReadUInt32();
			if (dataLen >= 2147483648) {
				dataLen = -4294967296;
			}

			object bodyObj;
			// Check for AMF3 kAvmPlusObjectType object type
			if (isAmf3) {
				byte typeMarker = reader.ReadByte();
				if (typeMarker == 17) {
					bodyObj = reader.ReadAMF3Data();
				} else {
					bodyObj = reader.ReadData();
				}
			} else {
				bodyObj = reader.ReadData();
			}


			DsoAmfBody body = new DsoAmfBody(targetUri, responseUri, bodyObj);
			return body;
		}
開發者ID:GodLesZ,項目名稱:svn-dump,代碼行數:30,代碼來源:DsoAmfBody.cs

示例2: Read

		public static DsoAmfBody Read(AMFReader reader) {
			reader.Reset();

			ushort targetUriLen = reader.ReadUInt16();
			string targetUri = reader.ReadUTF(targetUriLen); // When the message holds a response from a remote endpoint, the target URI specifies which method on the local client (i.e. reader request originator) should be invoked to handle the response.
			ushort responseUriLen = reader.ReadUInt16();
			string responseUri = reader.ReadUTF(responseUriLen); // The response's target URI is set to the request's response URI with an '/onResult' suffix to denote a success or an '/onStatus' suffix to denote a failure.

			int numBytes = 4;
			uint dataLen = 0;
			while (numBytes-- > 0)
				dataLen = (dataLen << 8) | reader.ReadByte();

			// Need to skip 1 byte more, dont know why..
			reader.ReadByte();
			object bodyObj = reader.ReadData(); // turn the element into real data


			DsoAmfBody body = new DsoAmfBody(targetUri, responseUri, bodyObj);
			return body;
		}
開發者ID:GodLesZ,項目名稱:svn-dump,代碼行數:21,代碼來源:DsoAmfBody.cs

示例3: Read

		public static DsoAmfHeader Read(AMFReader reader) {
			reader.Reset();

			ushort nameLen = reader.ReadUInt16();
			string name = reader.ReadUTF(nameLen);
			bool required = (reader.ReadByte() > 0); // find the must understand flag
			uint dataLen = reader.ReadUInt32();
			object headObj = reader.ReadData();

			DsoAmfHeader header = new DsoAmfHeader(name, required, headObj);
			return header;
		}
開發者ID:GodLesZ,項目名稱:svn-dump,代碼行數:12,代碼來源:DsoAmfHeader.cs

示例4: ReadData

		public object ReadData(AMFReader reader)
		{
			int length = reader.ReadInt32();
			return reader.ReadUTF(length);
		}
開發者ID:ByteSempai,項目名稱:Ubiquitous,代碼行數:5,代碼來源:AMF0LongStringReader.cs


注:本文中的AMFReader.ReadUTF方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。