forked from LeenkxTeam/LNXSDK
Update Aura
This commit is contained in:
17
lib/aura/Sources/aura/format/BytesExtension.hx
Normal file
17
lib/aura/Sources/aura/format/BytesExtension.hx
Normal file
@ -0,0 +1,17 @@
|
||||
package aura.format;
|
||||
|
||||
import haxe.io.Bytes;
|
||||
|
||||
using StringTools;
|
||||
|
||||
/**
|
||||
Variant of `aura.format.InputExtension.isByteMagic()` for `haxe.io.Bytes`.
|
||||
**/
|
||||
inline function isByteMagic(bytes: Bytes, position: Int, magicASCII: String): Bool {
|
||||
var match = true;
|
||||
for (i in 0...magicASCII.length) {
|
||||
match = match && bytes.get(position + i) == magicASCII.fastCodeAt(i);
|
||||
}
|
||||
|
||||
return match;
|
||||
}
|
||||
Reference in New Issue
Block a user