Package | starling.utils |
Class | public class ByteArrayUtil |
Inheritance | ByteArrayUtil ![]() |
Method | Defined By | ||
---|---|---|---|
compareByteArrays(a:ByteArray, indexA:int, b:ByteArray, indexB:int, numBytes:int = -1):Boolean [static] Compares the range of bytes within two byte arrays. | ByteArrayUtil | ||
startsWithBytes(byteArray:ByteArray, firstBytes:Array):Boolean [static] Figures out if a byte array starts with the given bytes. | ByteArrayUtil | ||
startsWithString(bytes:ByteArray, string:String):Boolean [static] Figures out if a byte array starts with the UTF bytes of a certain string. | ByteArrayUtil |
compareByteArrays | () | method |
public static function compareByteArrays(a:ByteArray, indexA:int, b:ByteArray, indexB:int, numBytes:int = -1):Boolean
Compares the range of bytes within two byte arrays.
Parameters
a:ByteArray | |
indexA:int | |
b:ByteArray | |
indexB:int | |
numBytes:int (default = -1 )
|
Boolean |
startsWithBytes | () | method |
public static function startsWithBytes(byteArray:ByteArray, firstBytes:Array):Boolean
Figures out if a byte array starts with the given bytes. Pass an array that contains integers in the range 0-255.
Parameters
byteArray:ByteArray | |
firstBytes:Array |
Boolean |
startsWithString | () | method |
public static function startsWithString(bytes:ByteArray, string:String):Boolean
Figures out if a byte array starts with the UTF bytes of a certain string. If the array starts with a 'BOM', it is ignored; so are leading zeros and whitespace.
Parameters
bytes:ByteArray | |
string:String |
Boolean |