Example #1
0
 public CodeTable(Stream byteStream)
 {
     try
     {
         var codeTableReader = new CodeTableXmlReader();
         codeTableReader.Read(byteStream);
         charsets  = codeTableReader.CharSets;
         combining = codeTableReader.CombiningChars;
     }
     catch (Exception e)
     {
         throw new MarcException(e.Message, e);
     }
 }
Example #2
0
 public CodeTable(String filename)
 {
     try
     {
         using (var fs = new FileStream(filename, FileMode.Open))
         {
             var codeTableReader = new CodeTableXmlReader();
             codeTableReader.Read(fs);
             charsets  = codeTableReader.CharSets;
             combining = codeTableReader.CombiningChars;
         }
     }
     catch (Exception e)
     {
         throw new MarcException(e.Message, e);
     }
 }
Example #3
0
        public CodeTable(Uri uri)
        {
            try
            {
                var response = WebRequest.Create(uri).GetResponse();
                using (var stream = response.GetResponseStream())
                {
                    var codeTableReader = new CodeTableXmlReader();
                    codeTableReader.Read(stream);
                    charsets  = codeTableReader.CharSets;
                    combining = codeTableReader.CombiningChars;
                }

                response.Close();
            }
            catch (Exception e)
            {
                throw new MarcException(e.Message, e);
            }
        }