优化
This commit is contained in:
@@ -28,4 +28,11 @@ object UTF8BOMFighter {
|
||||
}
|
||||
return bytes
|
||||
}
|
||||
|
||||
fun hasBom(bytes: ByteArray): Boolean {
|
||||
return (bytes.size > 3
|
||||
&& bytes[0] == UTF8_BOM_BYTES[0]
|
||||
&& bytes[1] == UTF8_BOM_BYTES[1]
|
||||
&& bytes[2] == UTF8_BOM_BYTES[2])
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user