Beispiel #1
0
        /// <inheritdoc/>
        public JudgeEncodingResponse GetEncoding(byte[] buffer)
        {
            JudgeEncodingResponse response = UseExtend.GetDefaultResponse();

            response.Encoding             = JudgeChineseGBK(buffer);
            response.ContentBytes         = buffer;
            response.IsReadFileALLContent = true;
            return(response);
        }
 /// <inheritdoc/>
 public JudgeEncodingResponse GetEncoding(FileInfo file)
 {
     using (FileStream fs = file.Open(FileMode.Open, FileAccess.Read))
     {
         using (BinaryReader br = new BinaryReader(fs))
         {
             byte[] buffer = br.ReadBytes(4);
             JudgeEncodingResponse response = UseExtend.GetDefaultResponse();
             response.Encoding = JudgeHeader(buffer);
             return(response);
         }
     }
 }