hasUtf16beBom static method
Identifies whether a List of bytes starts (based on offset) with a big-endian byte-order marker (BOM).
Implementation
static bool hasUtf16beBom(List<int> utf16EncodedBytes, [int offset = 0, int? length]) {
var end = length != null ? offset + length : utf16EncodedBytes.length;
return (offset + 2) <= end &&
utf16EncodedBytes[offset] == bigEndianBOM[0] &&
utf16EncodedBytes[offset + 1] == bigEndianBOM[1];
}