public void SendNetData(int id, byte[] buffer) { mNetPackage.command = id; mNetPackage.buffer = buffer; ArraySegment <byte> stream = NetEncryptionStream.Encryption(mNetPackage); mWaitSendBuffer.WriteFrom(stream.Array, stream.Offset, stream.Count); }
public void Test2() { QueueArraySegment <byte> mBuffer = new QueueArraySegment <byte> (1, 10); for (int i = 0; i < 100; i++) { byte[] aaa = new byte[] { 1, 2, 4, 5, 6, 7 }; mBuffer.WriteFrom(aaa, 0, aaa.Length); } DebugSystem.Log(mBuffer.ToString()); }