| author | Raphael Velt <raph.velt@gmail.com> |
| Thu, 06 Oct 2011 12:39:29 +0200 | |
| changeset 306 | 70c9688a1486 |
| parent 305 | tweetcast/client/lib/gimite-web-socket-js-55ae639/flash-src/third-party/com/hurlant/util/ArrayUtil.as@436a31d11f1d |
| permissions | -rwxr-xr-x |
|
305
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
1 |
/** |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
2 |
* ArrayUtil |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
3 |
* |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
4 |
* A class that allows to compare two ByteArrays. |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
5 |
* Copyright (c) 2007 Henri Torgemane |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
6 |
* |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
7 |
* See LICENSE.txt for full license information. |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
8 |
*/ |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
9 |
package com.hurlant.util { |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
10 |
import flash.utils.ByteArray; |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
11 |
|
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
12 |
|
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
13 |
public class ArrayUtil { |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
14 |
|
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
15 |
public static function equals(a1:ByteArray, a2:ByteArray):Boolean { |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
16 |
if (a1.length != a2.length) return false; |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
17 |
var l:int = a1.length; |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
18 |
for (var i:int=0;i<l;i++) { |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
19 |
if (a1[i]!=a2[i]) return false; |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
20 |
} |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
21 |
return true; |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
22 |
} |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
23 |
} |
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
24 |
|
|
436a31d11f1d
Ajout du streaming des tweets par WebSocket
Raphael Velt <raph.velt@gmail.com>
parents:
diff
changeset
|
25 |
} |