Example #1
0
        private void CopyBomTo(byte[] outputData, EncodingType encoding, out int outputIndex)
        {
            var bom = encoding.GetByteOrderMark();

            outputIndex = 0;
            CopyDataToOutput(bom, outputData, ref outputIndex);
        }
Example #2
0
        private bool HasBom(byte[] data, int dataLength, EncodingType encoding)
        {
            var bom = encoding.GetByteOrderMark();

            if (data.Length < bom.Length || dataLength < bom.Length)
            {
                return(false);
            }

            return(data.Take(bom.Length).SequenceEqual(bom));
        }