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


C# RakString.CopyData方法代碼示例

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


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

示例1: Main


//.........這裏部分代碼省略.........
            testByteQueue.Print();
            testByteQueue.ReadBytes(returnArray, (uint)returnArray.Length, true);
            testByteQueue.Clear("", 0);

            testBitStream2.AddBitsAndReallocate(99);
            testBitStream2.AlignReadToByteBoundary();
            testBitStream2.AlignWriteToByteBoundary();
            testBitStream2.EndianSwapBytes(5, 5);
            returnArray = testBitStream2.GetData();
            Console.WriteLine(testBitStream2.GetNumberOfBitsAllocated());
            Console.WriteLine(testBitStream2.GetNumberOfBitsUsed());
            Console.WriteLine(testBitStream2.GetNumberOfBytesUsed());
            Console.WriteLine(testBitStream2.GetNumberOfUnreadBits());
            Console.WriteLine(testBitStream2.GetReadOffset());
            Console.WriteLine(testBitStream2.GetWriteOffset());
            testBitStream2.SetData(returnArray);
            testBitStream2.SetNumberOfBitsAllocated(testBitStream2.GetNumberOfBitsAllocated());
            testBitStream2.SetReadOffset(3);
            testBitStream2.SetWriteOffset(3);
            testBitStream2.WriteBits(returnArray, (uint)returnArray.Length);

            //Cell, Table, Row
            Console.WriteLine("Cell, Table, Row");
            Cell testCell = new Cell();
            Byte[] tableTestByteArray = new byte[1];
            tableTestByteArray[0] = (byte)'t';
            int outInt;
            double outDouble;

            testCell.Set("test1232");
            testCell.Get(out testString);
            Console.WriteLine(testString);
            Console.WriteLine((int)testCell.EstimateColumnType());
            testCell.CopyData(testCell);
            testCell.Set(12.5d);
            testCell.Get(out outDouble);
            Console.WriteLine(outDouble);
            testCell.Set((uint)1);
            testCell.Set((int)1);
            testCell.Get(out outInt);
            Console.WriteLine(outInt);
            testCell.Set(tableTestByteArray, tableTestByteArray.Length);
            testCell.Get(tableTestByteArray, out outInt);
            Console.WriteLine(testCell.i);
            Console.WriteLine(testCell.isEmpty);

            Table testTable = new Table();
            testTable.Clear();
            testTable.AddColumn("testNumeric", Table.ColumnType.NUMERIC);
            testTable.AddColumn("testString", Table.ColumnType.STRING);
            testTable.AddColumn("testBinary", Table.ColumnType.BINARY);
            testTable.AddRow(0, new RakNetListCell());
            testTable.AddRow(1, new RakNetListCell());
            testTable.AddRow(2);
            testTable.AddRow(3);
            testTable.AddRow(4);
            testTable.AddRow(5);

            Console.WriteLine(testTable.ColumnIndex("testNumeric"));
            Console.WriteLine(testTable.ColumnName(0));
            Console.WriteLine(testTable.GetAvailableRowId());
            testTable.UpdateCell(0, 0, 9);
            testTable.UpdateCell(0, 1, "testCell");
            testTable.UpdateCell(0, 2, 1, tableTestByteArray);
            testTable.GetCellValueByIndex(0, 0, out outInt);
            Console.WriteLine(outInt);
開發者ID:0521guo,項目名稱:RakNet,代碼行數:67,代碼來源:TestMain.cs


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